Interface CompiledStatement


  • public interface CompiledStatement
    Statement that has been compiled and is ready to be run from the REPL.

    If a declaration, it evaluates an expression and also creates a new environment (with new variables bound) and generates a line or two of output for the REPL.

    • Method Detail

      • eval

        void eval​(Session session,
                  Environment environment,
                  Consumer<String> outLines,
                  Consumer<Binding> outBindings)
        Evaluates this statement, adding lines of feedback to output and writing bindings (values to variables, and types definitions) to bindings. The environment for the next statement can be constructed from the bindings.
        Parameters:
        session - Session
        environment - Evaluation environment
        outLines - List to which to append lines of output
        outBindings - List to which to append bound variables and types
      • getType

        Type getType()