Documentation
¶
Index ¶
- Variables
- func Add(a, b any) any
- func ArrayGet(arr any, idx int64) any
- func ArrayLen(arr any) int64
- func ArrayPush(arr any, val any) any
- func ArraySet(arr any, idx int64, val any) any
- func CallFunc(fn any, env *Env, args ...any) any
- func CompleteGoJob(id int)
- func Deref(p any) any
- func Div(a, b any) any
- func Eq(a, b any) bool
- func ExpandStr(s string, env *Env) string
- func GreaterEq(a, b any) bool
- func GreaterThan(a, b any) bool
- func IsTruthy(v any) bool
- func LessEq(a, b any) bool
- func LessThan(a, b any) bool
- func MemberGet(obj any, prop string) any
- func Mod(a, b any) any
- func Mul(a, b any) any
- func NewError(msg string) error
- func NotEq(a, b any) bool
- func RegisterGoJob(cmd string) int
- func ResetImports()
- func SetPtr(p any, val any)
- func Sub(a, b any) any
- func ToStr(v any) string
- func WaitAll()
- func WaitAllTimeout(secs any)
- type CompiledScript
- type Env
- func (e *Env) Get(name string) (any, bool)
- func (e *Env) GetInt(name string) int64
- func (e *Env) GetStr(name string) string
- func (e *Env) GetString(name string) (string, bool)
- func (e *Env) Set(name string, val any)
- func (e *Env) SetBool(name string, v bool)
- func (e *Env) SetFloat(name string, v float64)
- func (e *Env) SetInt(name string, v int64)
- func (e *Env) SetStr(name string, v string)
- func (e *Env) SetString(name string, val string)
- type Ptr
- type Task
Constants ¶
This section is empty.
Variables ¶
var GeneratedImports []string
PrependImport registers a Go import path for the generated file. Not a runtime operation; used by the compiler to track imports.
Functions ¶
func CallFunc ¶
CallFunc calls a function value with the given arguments. Typed function variables are resolved to direct calls at compile time (see compileCallExpression in compiler.go); this function serves as the runtime fallback for truly dynamic cases only.
func Deref ¶
Deref dereferences a pointer to get its value. Accepts *Ptr or any (will try type assertion).
func GreaterThan ¶
func MemberGet ¶
MemberGet gets a member value from an object. This should not be reached for well-formed programs — all member access should be resolved at compile time. Panics to surface bugs immediately.
func RegisterGoJob ¶
RegisterGoJob registers a goroutine-based background job and returns its ID.
func ResetImports ¶
func ResetImports()
ResetImports clears the global import tracker and background job state. Called at the start of every compiled main() to prevent state leaks between runs.
func SetPtr ¶
SetPtr sets the value through a pointer. Accepts *Ptr or any (will try type assertion).
func WaitAllTimeout ¶
func WaitAllTimeout(secs any)
WaitAllTimeout blocks until all jobs finish or timeout.
Types ¶
type CompiledScript ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
type Ptr ¶
Ptr represents a pointer to a variable in compiled Kami code. Uses closures to capture variable references without relying on Env.
func NewPtr ¶
NewPtr creates a pointer to a variable with any-typed closures. get returns the current value, set updates it.
func NewPtrBool ¶
NewPtrBool creates a pointer to a bool variable.
func NewPtrFloat64 ¶
NewPtrFloat64 creates a pointer to a float64 variable.
func NewPtrInt64 ¶
NewPtrInt64 creates a pointer to an int64 variable.
func NewPtrString ¶
NewPtrString creates a pointer to a string variable.