Package net.hydromatic.morel.eval
Interface EvalEnv
-
- All Known Subinterfaces:
MutableEvalEnv
- All Known Implementing Classes:
EvalEnvs.MapEvalEnv,EvalEnvs.MutableSubEvalEnv,EvalEnvs.SubEvalEnv
public interface EvalEnvEvaluation environment.Whereas
Environmentcontains both types and values, because it is used for validation/compilation, EvalEnv contains only values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EvalEnvbind(java.lang.String name, java.lang.Object value)Creates an environment that has the same content as this one, plus the binding (name, value).default MutableEvalEnvbindMutable(java.lang.String name)Creates an evaluation environment that has the same content as this one, plus a mutable slot.java.lang.ObjectgetOpt(java.lang.String name)Returns the binding ofnameif bound, null if not.default java.util.Map<java.lang.String,java.lang.Object>valueMap()Returns a map of the values and bindings.voidvisit(java.util.function.BiConsumer<java.lang.String,java.lang.Object> consumer)Visits every variable binding in this environment.
-
-
-
Method Detail
-
getOpt
java.lang.Object getOpt(java.lang.String name)
Returns the binding ofnameif bound, null if not.
-
bind
default EvalEnv bind(java.lang.String name, java.lang.Object value)
Creates an environment that has the same content as this one, plus the binding (name, value).
-
bindMutable
default MutableEvalEnv bindMutable(java.lang.String name)
Creates an evaluation environment that has the same content as this one, plus a mutable slot.
-
visit
void visit(java.util.function.BiConsumer<java.lang.String,java.lang.Object> consumer)
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
default java.util.Map<java.lang.String,java.lang.Object> valueMap()
Returns a map of the values and bindings.
-
-