Struct ketos::interpreter::Interpreter [] [src]

pub struct Interpreter { /* fields omitted */ }

Provides a context in which to compile and execute code.

Values created by one interpreter are exclusive to that interpreter. They should not be passed directly into another interpreter. Specifically, unexpected behavior or a panic may occur if another interpreter attempts to operate on Name/Keyword values created by another interpreter or any values which may contain arbitrary values (Struct, StructDef, List, Lambda, Quote, etc.).

Methods

impl Interpreter
[src]

Creates a new Interpreter.

Creates a new Interpreter using the given ModuleLoader instance.

Creates a new Interpreter using the given Context instance.

Creates a new Interpreter using the given Scope instance.

Creates a new Interpreter that searches for module files in a given series of directories.

Clears cached source from the contained CodeMap.

Note

This will invalidate any previously created ParseError values.

Prints an error to stderr.

Prints traceback information to stderr.

Prints a string representation of a value to stdout.

Formats an error into a String.

Formats a Trace into a String.

The result does not include the "Traceback:" preamble.

Returns the traceback from the most recent error.

The traceback will remain stored for future calls to get_traceback.

Removes and returns the traceback from the most recent error.

Formats a value into a string.

Executes a bare Code object taking no parameters.

Executes a Rc<Code> object taking no parameters.

Executes a series of code objects sequentially and returns the value of the final expression. If code is empty, the value () is returned.

Calls a named function with the given arguments.

Calls a function with the given arguments.

Returns a value, if present, in the interpreter scope.

Returns a borrowed reference to the contained context.

Returns a borrowed reference to the contained scope.

Sets the value of argv within the execution scope.

Compiles and executes the contents of a file.

Compiles and executes an input expression.

Parses and executes a series of expressions and return the last value.

Compiles and compiles a single expression and returns a code object. If the input string contains more than one expression, an error is returned.

Compiles and compiles a series of expressions.

Parses a single expression and returns it as a Value. If input contains more than one expression, an error is returned.

Parses a series of expressions and returns them as Values.

Parses a series of expressions from the contents of a file and returns them as Values.

Trait Implementations

impl Clone for Interpreter
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more