class Myst::ClosureScope

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.cr

Constructors

Instance Method Summary

Instance methods inherited from class Myst::Scope

[](key : String) : Value [], []=(key : String, value : Value) : Value []=, []?(key : String) : Value | Nil []?, assign(key : String, value : Value) assign, clear(*args, **options)
clear(*args, **options, &)
clear
, each(*args, **options)
each(*args, **options, &)
each
, has_key?(key : String) has_key?, parent : Scope | Nil parent, parent=(parent : Scope | Nil) parent=, values : Hash(String, Value) values, values=(values : Hash(String, Value)) values=

Constructor methods inherited from class Myst::Scope

new(parent : Scope | Nil = nil) new

Constructor Detail

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

[View source]

Instance Method Detail

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

[View source]
def []?(key : String) #
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.


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

[View source]
def closed_scope : Scope #

[View source]
def closed_scope=(closed_scope : Scope) #

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

[View source]