An entity that represents some program object.
An environment is a stack of scopes with the innermost scope on the top.
An entity that represents an error situation.
A entity represented by names for whom we have seen more than one declaration so we are unsure what is being represented.
Support for unique ids for named things.
A named entity.
A scope maps identifiers to entities.
An unknown entity, represented by names whose declarations are missing.
Static support for entity names.
Define i to be e in the current scope of env, raising an error if the environment is empty.
Enter a new empty scope nested within the given environment.
Say whether i is defined in any scope of env.
Say whether i is defined in an innermost scope of env (i.
Say whether i is defined in an innermost scope of env (i.e., in the current scope).
Say whether i is defined in an outer scope of env (i.
Say whether i is defined in an outer scope of env (i.e., not in the current scope).
Say whether i is defined in the given scope.
Say whether i is defined in the current scope of env.
Leave the outermost scope of the given environment, raising an error if the environment is empty.
Look up i in env, returning the mapped Entity if there is one, otherwise return e.
Look up i in env, returning the mapped Entity if there is one, otherwise return e. If scope is true, just search the innermost scope, otherwise search outwards in all scopes, returning the first Entity found, if any.
Reset the environment module.
Create a root environment, i.
Create a root environment, i.e., one that has a single scope containing the given bindings.
General implementation of environments as stacked scopes. The objects associated with names in environments are of type Entity.