Trait InterpreterContext

Source
pub trait InterpreterContext: Context + Sized {
    type RuntimeError: Debug;

    // Required methods
    fn eval(
        expr: Gc<Self::Expr>,
        env: &mut GcLinkedList<(Symbol, Gc<Value<Self>>)>,
    ) -> Result<Gc<Value<Self>>, Self::RuntimeError>;
    fn primitives() -> HashMap<Symbol, Gc<Value<Self>>>;
}
Expand description

A Context that allows for the running of OftLisp code.

Required Associated Types§

Source

type RuntimeError: Debug

An error encountered at runtime.

Required Methods§

Source

fn eval( expr: Gc<Self::Expr>, env: &mut GcLinkedList<(Symbol, Gc<Value<Self>>)>, ) -> Result<Gc<Value<Self>>, Self::RuntimeError>

Evaluates an expression.

Source

fn primitives() -> HashMap<Symbol, Gc<Value<Self>>>

Returns the values in the std/internal/primitives module.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§