Signo.Env (Signo v0.0.2)
View SourceStruct holding all variable and function definitions in a certain scope.
Scopes can be nested. Whenever a variable is being looked up, the lookup will walk the scope-chain up until it finds a definition.
Summary
Types
@type definitions() :: Enumerable.t({Signo.AST.ref(), Signo.AST.value()})
@type scope() :: %{required(Signo.AST.ref()) => Signo.AST.value()}
Functions
@spec assign(t(), Signo.AST.ref(), Signo.AST.value(), Signo.Position.t()) :: t()
@spec import(t(), Signo.AST.ref(), definitions()) :: t()
@spec lookup!(nil, Signo.AST.ref(), Signo.Position.t()) :: no_return()
@spec lookup!(t(), Signo.AST.ref(), Signo.Position.t()) :: Signo.AST.value()
@spec new(t(), definitions()) :: t()