Pantagruel v0.3.0 Pantagruel.Env View Source

The evaluation environment for a Pantagruel program.

Link to this section Summary

Types

t()

An environment is a list of binding contexts, one scope for each section of the program. Symbols are bound into scope by being referred to in one of several declaration forms, at which point they are inserted into the scope for that section

Functions

Introduce a new variable into this scope

Check a list of values for binding in the given scope, and raise if anything is unbound

Extend an exection environment with a new scope

Return whether a given value is bound in any of: the current scope, any of the previous env, the starting environment. Given any complex value, recurse into its component symbols and check them for binding

If a value has been defined in the starting environment, find the name it was bound under

Start a new execution environment

Link to this section Types

An environment is a list of binding contexts, one scope for each section of the program. Symbols are bound into scope by being referred to in one of several declaration forms, at which point they are inserted into the scope for that section.

Link to this section Functions

Link to this function args_and_domains(bindings) View Source

Introduce a new variable into this scope.

Link to this function bind_expression_variables(scope, arg2) View Source
Link to this function check_unbound(env, candidates) View Source
check_unbound(t(), [any()]) ::
  :ok | {:error, {:unbound_variables, MapSet.t(), t()}}

Check a list of values for binding in the given scope, and raise if anything is unbound.

Link to this function extend(env, mod_name) View Source
extend(t(), atom()) :: t()

Extend an exection environment with a new scope.

Link to this function extract_binding_symbols(bindings) View Source
Link to this function is_bound?(v, env) View Source
is_bound?(any(), t()) :: boolean()

Return whether a given value is bound in any of: the current scope, any of the previous env, the starting environment. Given any complex value, recurse into its component symbols and check them for binding.

Link to this function lookup_binding_name(symbol) View Source
lookup_binding_name(any()) :: String.t()

If a value has been defined in the starting environment, find the name it was bound under.

Start a new execution environment.