2024-10-09 19:57:52 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
func defineGlobals(env *Environment) {
|
|
|
|
|
2024-10-11 17:01:12 +03:00
|
|
|
env.define("clock", &Callable{
|
2024-10-09 19:57:52 +03:00
|
|
|
arity: 0,
|
|
|
|
call: func(i *Interpreter, arg ...any) any {
|
|
|
|
return time.Now().Unix()
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|