mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-01 08:42:04 +00:00
this is the only way i could think of to be able to push go functions to lua on the clua side. this may or may not need adjustments on golua side though...
30 lines
522 B
Go
30 lines
522 B
Go
//go:build midnight
|
|
|
|
package moonlight
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type Callable interface {
|
|
Continuation(*Runtime, Cont) Cont
|
|
}
|
|
|
|
type Closure struct {
|
|
refIdx int // so since we cant store the actual lua closure,
|
|
// we need a index to the ref in the lua registry... or something like that.
|
|
}
|
|
|
|
func (mlr *Runtime) ClosureArg(num int) (*Closure, error) {
|
|
fmt.Println("type at ", num, "is", mlr.state.LTypename(num))
|
|
|
|
return &Closure{
|
|
refIdx: -1,
|
|
}, nil
|
|
}
|
|
|
|
/*
|
|
func (c *Closure) Continuation(mlr *Runtime, c Cont) Cont {
|
|
}
|
|
*/
|