Documentation
¶
Index ¶
- type MechBasic
- func (mb *MechBasic) Call(funcName string, args ...any) (any, error)
- func (mb *MechBasic) HasFunction(funcName string) bool
- func (mb *MechBasic) Load(code string) error
- func (mb *MechBasic) RegisterFunc(name string, function func(args ...any) (any, error))
- func (mb *MechBasic) RegisterMathLibrary()
- func (mb *MechBasic) Run(code string) error
- func (mb *MechBasic) SetPrintFunc(fn func(value any))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MechBasic ¶
type MechBasic struct {
// contains filtered or unexported fields
}
func NewMechanicalBasic ¶
func NewMechanicalBasic() *MechBasic
func (*MechBasic) Call ¶
Call invokes a script-defined function by name with the provided arguments Each call starts with a fresh scope - variables do not persist between calls
func (*MechBasic) HasFunction ¶
HasFunction checks if a function with the given name exists in the loaded script
func (*MechBasic) Load ¶
Load parses the script and registers function definitions without executing top-level code
func (*MechBasic) RegisterFunc ¶
func (*MechBasic) RegisterMathLibrary ¶
func (mb *MechBasic) RegisterMathLibrary()
func (*MechBasic) SetPrintFunc ¶
Click to show internal directories.
Click to hide internal directories.