Package net.hydromatic.morel.eval
Interface EvalEnv
- All Known Subinterfaces:
MutableEvalEnv
- All Known Implementing Classes:
EvalEnvs.ArraySubEvalEnv,EvalEnvs.MapEvalEnv,EvalEnvs.MutableArraySubEvalEnv,EvalEnvs.MutablePatSubEvalEnv,EvalEnvs.MutableSubEvalEnv,EvalEnvs.PatSubEvalEnv,EvalEnvs.SubEvalEnv
public interface EvalEnv
Evaluation environment.
Whereas Environment contains both types and values,
because it is used for validation/compilation, EvalEnv contains
only values.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault EvalEnvCreates an environment that has the same content as this one, plus the binding (name, value).default MutableEvalEnvbindMutable(String name) Creates an evaluation environment that has the same content as this one, plus a mutable slot.default MutableEvalEnvbindMutableArray(List<String> names) Creates an evaluation environment that has the same content as this one, plus a mutable slot or slots.default MutableEvalEnvbindMutablePat(Core.Pat pat) Creates an evaluation environment that has the same content as this one, plus mutable slots for each name in a pattern.default EvalEnvfix()Converts this environment to a non-mutable environment.Returns the binding ofnameif bound, null if not.valueMap()Returns a map of the values and bindings.voidvisit(BiConsumer<String, Object> consumer) Visits every variable binding in this environment.
-
Field Details
-
SESSION
The name of the variable that contains theSession.- See Also:
-
-
Method Details
-
getOpt
Returns the binding ofnameif bound, null if not. -
bind
Creates an environment that has the same content as this one, plus the binding (name, value). -
bindMutable
Creates an evaluation environment that has the same content as this one, plus a mutable slot. -
bindMutablePat
Creates an evaluation environment that has the same content as this one, plus mutable slots for each name in a pattern. -
bindMutableArray
Creates an evaluation environment that has the same content as this one, plus a mutable slot or slots.If
nameshas one element, callingMutableEvalEnv.set(Object)will populate the slot will be filled by an object; ifnameshas more than one element,setwill expect to be given an array with the same number of elements. -
visit
Visits every variable binding in this environment.Bindings that are obscured by more recent bindings of the same name are visited, but after the more obscuring bindings.
-
valueMap
Returns a map of the values and bindings. -
fix
Converts this environment to a non-mutable environment.
-