class Ven::Suite::Context::Machine
- Ven::Suite::Context::Machine
- Reference
- Object
Overview
The context for a Machine.
Defined in:
ven/suite/context.crConstant Summary
-
MAX_TRACES =
64 -
Maximum amount of traceback entries. Clears the traces if exceeds.
Instance Method Summary
-
#[](symbol : String | VSymbol)
Returns the value of a symbol.
-
#[]=(symbol : String, value : Model, nest = -1)
Makes symbol be value in the localmost scope.
-
#[]=(symbol : VSymbol, value : Model)
Makes symbol be value in its nest, or, if no nest specified, in the localmost scope.
-
#[]?(symbol : String, maybe = nil)
Returns the value of symbol.
-
#[]?(symbol : VSymbol)
Returns the value of symbol.
-
#clear
Deletes all scopes except the globalmost.
-
#pop
Pops the current scope and the current trace.
-
#push(file, line, name)
Introduces a child scope and a child trace.
-
#scopes : Array(Scope)
The scopes of this context.
-
#size(*args, **options)
Returns the amount of scopes (aka scope depth, nesting) in this context.
-
#size(*args, **options, &)
Returns the amount of scopes (aka scope depth, nesting) in this context.
-
#traces : Array(Ven::Suite::Trace)
The traceback of this context.
Instance Method Detail
Returns the value of a symbol.
Raises if symbol was not found.
Makes symbol be value in the localmost scope.
If the localmost scope includes a metacontext ($),
and that metacontext has a field named symbol, this
field will be set to value instead.
Will raise VenAssignmentError if symbol already
exists and is an MFunction, whilst value is not.
Makes symbol be value in its nest, or, if no nest specified, in the localmost scope.
Returns the value of symbol.
Respects the metacontext ($).
Nests maybe and -1 will be searched in first.
Returns nil if symbol was not found.
Returns the value of symbol.
Respects the metacontext ($).
Returns nil if symbol was not found.
Introduces a child scope and a child trace.
Deletes all existing traces if the amount of them
exceeds MAX_TRACES.
Returns the amount of scopes (aka scope depth, nesting) in this context.
Returns the amount of scopes (aka scope depth, nesting) in this context.