Struct endbasic_core::syms::Symbols [−][src]
pub struct Symbols { /* fields omitted */ }
Expand description
Storage for all symbols that exist at runtime.
Implementations
Registers the given builtin command.
Given that commands cannot be defined at runtime, specifying a non-unique name results in a panic.
Registers the given builtin function.
Given that functions cannot be defined at runtime, specifying a non-unique name results in a panic.
Returns the mapping of all symbols.
Defines a new variable name
of type vartype
. The variable must not yet exist.
Defines a new array name
of type subtype
with dimensions
. The array must not yet
exist, and the name may not overlap function or variable names.
Obtains the value of a symbol or None
if it is not defined.
Returns an error if the type annotation in the symbol reference does not match its type.
Obtains the value of a symbol or None
if it is not defined.
Returns an error if the type annotation in the symbol reference does not match its type.
Obtains the value of a variable.
Returns an error if the variable is not defined, if the referenced symbol is not a variable, or if the type annotation in the variable reference does not match the type of the value that the variable contains.
Adds a type annotation to the symbol reference if the symbol is already defined and the reference lacks one.
Sets the value of a variable.
If vref
contains a type annotation, the type of the value must be compatible with that
type annotation.
If the variable is already defined, then the type of the new value must be compatible with the existing variable. In other words: a variable cannot change types while it’s alive.