Interface EvalEnv

    • Method Detail

      • getOpt

        Object getOpt​(String name)
        Returns the binding of name if bound, null if not.
      • bind

        default EvalEnv bind​(String name,
                             Object value)
        Creates an environment that has the same content as this one, plus the binding (name, value).
      • bindMutable

        default MutableEvalEnv bindMutable​(String name)
        Creates an evaluation environment that has the same content as this one, plus a mutable slot.
      • bindMutablePat

        default MutableEvalEnv bindMutablePat​(Core.Pat pat)
        Creates an evaluation environment that has the same content as this one, plus mutable slots for each name in a pattern.
      • bindMutableArray

        default MutableEvalEnv bindMutableArray​(List<String> names)
        Creates an evaluation environment that has the same content as this one, plus a mutable slot or slots.

        If names has one element, calling MutableEvalEnv.set(Object) will populate the slot will be filled by an object; if names has more than one element, set will expect to be given an array with the same number of elements.

      • visit

        void visit​(BiConsumer<String,​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 Map<String,​Object> valueMap()
        Returns a map of the values and bindings.
      • fix

        default EvalEnv fix()
        Converts this environment to a non-mutable environment.