The type of entries of this environment, i.e.
The type of entries of this environment, i.e. the type that contains all relevant information about a given variable/function/other part of the environment.
The type by which this environment's entries are indexed.
The type by which this environment's entries are indexed. This will usually be String, some type to represent (qualified) names or some type to represent name+types combinations (for overloadable functions).
A human-readable name for items of this environment.
A human-readable name for items of this environment. This will be something like "variable" or "function". It
will be used in error messages, so for example for an environment Variable with description = "variable"
Variable.use would produce "Variable expected, but ... found" if the parse failed.
Method that gets called when a definition is encountered for an identifier that's already bound in the same scope.
Method that gets called when a definition is encountered for an identifier that's already bound in the same scope. The default behavior is to simply replace the current entry, but this method may be overridden to, say, cause a warning or error instead.
Each object inheriting this trait will provide an environment for the given type of entities and provide combinators to add to the environment globally or locally and combinators that match any current environment entry.
Example implementation:
object Variables extends Env { type Ident = String type Entry = VariableInfo }
object Functions extends Env { type Ident = FunctionSignature type Entry = FunctionInfo }