Pantagruel v0.0.8 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

Return whether a given value is bound in any of: the current scope, any of the previous scopes, 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

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 bind(scope, name, value) View Source
bind(scope(), any(), any()) :: scope()

Introduce a new variable into this scope.

Link to this function check_unbound(scopes, candidates) View Source
check_unbound(t(), [any()]) :: :ok

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

Return whether a given value is bound in any of: the current scope, any of the previous scopes, 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

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