Documentation
¶
Overview ¶
Package tcl provides a script engine implementation using the modernc.org/tcl library — a CGo-free port of the Tool Command Language (https://tcl.tk).
Construction:
eng, _ := tcl.New(ctx) eng.Init(ctx) eng.LoadString(ctx, "hello", `puts "hello world"`) eng.Execute(ctx)
The engine supports hot-reload via StartWatch/StopWatch when the bound Source implements the Watcher interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTCLEngineNotInitialized is returned when an operation is invoked // before Init or after Close. ErrTCLEngineNotInitialized = errors.New("tcl engine not initialized") // ErrTCLEngineAlreadyInitialized is returned when Init is called on an // already-initialized engine. ErrTCLEngineAlreadyInitialized = errors.New("tcl engine already initialized") // ErrTCLEvalFailed is returned when evaluating a TCL script fails. ErrTCLEvalFailed = errors.New("tcl eval failed") // ErrTCLNoScriptLoaded is returned when Execute is called but no script // has been loaded. ErrTCLNoScriptLoaded = errors.New("tcl no script loaded") // ErrTCLFunctionNotFound is returned when CallFunction cannot find the // named function. ErrTCLFunctionNotFound = errors.New("tcl function not found") // ErrTCLGlobalNotFound is returned when GetGlobal cannot find the named // variable. ErrTCLGlobalNotFound = errors.New("tcl global not found") // ErrTCLCallFailed is returned when calling a TCL function fails. ErrTCLCallFailed = errors.New("tcl call failed") )
Sentinel errors returned by the TCL engine.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.