class Ven::Suite::Context::Machine

Overview

The context for a Machine.

Defined in:

ven/suite/context.cr

Constant Summary

MAX_TRACES = 64

Maximum amount of traceback entries. Clears the traces if exceeds.

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def [](symbol : String | VSymbol) #

Returns the value of a symbol.

Raises if symbol was not found.


[View source]
def []=(symbol : String, value : Model, nest = -1) #

Makes symbol be value in the localmost scope.

If the localmost scope contains a meta-context ($), and that meta-context has a field named symbol, this field will be set to value.

Will raise VenAssignmentError if symbol already exists and is an MFunction, whilst value is not.


[View source]
def []=(symbol : VSymbol, value : Model) #

Makes symbol be value in its nest, or, if no nest specified, in the localmost scope.


[View source]
def []?(symbol : String, maybe = nil) #

Returns the value of symbol.

Respects the meta-context ($).

Nests maybe and -1 will be searched in first.

Returns nil if symbol was not found.


[View source]
def []?(symbol : VSymbol) #

Returns the value of symbol.

Respects the meta-context ($).

Nests maybe and -1 will be searched in first.

Returns nil if symbol was not found.


[View source]
def clear #

Deletes all scopes except the globalmost.


[View source]
def pop #

Pops the current scope and the current trace.


[View source]
def push(file, line, name) #

Introduces a child scope and a child trace.

Deletes all existing traces if the amount of them is bigger than MAX_TRACES.


[View source]
def scopes : Array(Scope) #

[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def traces : Array(Ven::Suite::Trace) #

[View source]