Package net.hydromatic.morel.eval
Class EvalEnvs.MutablePatSubEvalEnv
- java.lang.Object
-
- net.hydromatic.morel.eval.EvalEnvs.ArraySubEvalEnv
-
- net.hydromatic.morel.eval.EvalEnvs.PatSubEvalEnv
-
- net.hydromatic.morel.eval.EvalEnvs.MutablePatSubEvalEnv
-
- All Implemented Interfaces:
EvalEnv,MutableEvalEnv
- Enclosing class:
- EvalEnvs
static class EvalEnvs.MutablePatSubEvalEnv extends EvalEnvs.PatSubEvalEnv implements MutableEvalEnv
Evaluation environment that binds several slots based on a pattern.
-
-
Field Summary
Fields Modifier and Type Field Description private intslot-
Fields inherited from class net.hydromatic.morel.eval.EvalEnvs.PatSubEvalEnv
pat
-
Fields inherited from class net.hydromatic.morel.eval.EvalEnvs.ArraySubEvalEnv
names, parentEnv, values
-
-
Constructor Summary
Constructors Constructor Description MutablePatSubEvalEnv(EvalEnv parentEnv, Core.Pat pat, List<String> names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanbindRecurse(Core.Pat pat, Object argValue)EvalEnvfix()Converts this environment to a non-mutable environment.voidset(Object value)Puts a value into this environment.booleansetOpt(Object value)Puts a value into this environment in a way that may not succeed.-
Methods inherited from class net.hydromatic.morel.eval.EvalEnvs.ArraySubEvalEnv
getOpt, visit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.hydromatic.morel.eval.EvalEnv
bind, bindMutable, bindMutableArray, bindMutablePat, getOpt, valueMap, visit
-
-
-
-
Method Detail
-
fix
public EvalEnv fix()
Description copied from interface:EvalEnvConverts this environment to a non-mutable environment.
-
set
public void set(Object value)
Description copied from interface:MutableEvalEnvPuts a value into this environment.- Specified by:
setin interfaceMutableEvalEnv
-
setOpt
public boolean setOpt(Object value)
Description copied from interface:MutableEvalEnvPuts a value into this environment in a way that may not succeed.For example, if this environment is based on the pattern (x, 2) then (1, 2) will succeed and will bind x to 1, but (3, 4) will fail.
The default implementation calls
MutableEvalEnv.set(java.lang.Object)and always succeeds.- Specified by:
setOptin interfaceMutableEvalEnv
-
-