class Myst::Scope

Direct Known Subclasses

Defined in:

myst/interpreter/scope.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(parent : Scope | Nil = nil) #

[View source]

Instance Method Detail

def [](key : String) : Value #

[View source]
def []=(key : String, value : Value) : Value #

[View source]
def []?(key : String) : Value | Nil #

The shorthand access notations (#[]?, #[], #[]=) will all fall back to the parent scope if the value does not exist in this scope.

The longhand #has_key? and #assign only operate on this scope.


[View source]
def assign(key : String, value : Value) #

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

Remove all values from this scope. Parent scopes are not affected.


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

Remove all values from this scope. Parent scopes are not affected.


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

Remove all values from this scope. Parent scopes are not affected.


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

Remove all values from this scope. Parent scopes are not affected.


[View source]
def has_key?(key : String) #

[View source]
def parent : Scope | Nil #

[View source]
def parent=(parent : Scope | Nil) #

[View source]
def values : Hash(String, Value) #

[View source]
def values=(values : Hash(String, Value)) #

[View source]