glox/globals.go
2024-10-09 19:57:52 +03:00

13 lines
196 B
Go

package main
import "time"
func defineGlobals(env *Environment) {
env.set("clock", &Callable{
arity: 0,
call: func(i *Interpreter, arg ...any) any {
return time.Now().Unix()
},
})
}