class Myst::ClosureScope
- Myst::ClosureScope
- Myst::Scope
- Reference
- Object
Overview
A ClosureScope is a specially kind of Scope that allows direct access to closured entries from the parent scope, but also does not allow access to scopes beyond the parent.
Defined in:
myst/interpreter/closure_scope.crConstructors
Instance Method Summary
- #[]=(key : String, value : MTValue)
- #[]?(key : String)
- #assign(key : String, value : MTValue)
- #closed_scope : Scope
- #closed_scope=(closed_scope : Scope)
- #has_key?(key : String)
Instance methods inherited from class Myst::Scope
[](key : String) : MTValue
[],
[]=(key : String, value : MTValue) : MTValue
[]=,
[]?(key : String) : MTValue | Nil
[]?,
assign(key : String, value : MTValue)
assign,
clear(*args, **options)clear(*args, **options, &) clear, each(*args, **options)
each(*args, **options, &) each, has_key?(key : String) has_key?, inspect(io : IO) inspect, parent : Scope | Nil parent, parent=(parent : Scope | Nil) parent=, values : Hash(String, MTValue) values, values=(values : Hash(String, MTValue)) values=
Constructor methods inherited from class Myst::Scope
new(parent : Scope | Nil = nil)
new
Constructor Detail
Instance Method Detail
Description copied from class Myst::Scope
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.