Trait oftlisp::Context
[−]
[src]
pub trait Context: Sized { type BuiltinFunction: Clone + Debug + Finalize + Trace; type Expr: Clone + Debug + Finalize + Trace; type ObjectVtable: Clone + Debug + Finalize + Trace; type UserFunction: Clone + Debug + Finalize + Trace; type ValueMeta: Clone + Debug + Default + Finalize + Trace; fn from_expr(expr: Gc<Expr<Self>>) -> Gc<Self::Expr>; }
A trait for the things a Value
is parameterized
over.
Yeah, it's vague. Basically, think of it as a collection of associated
types that is used to define Value
.
Associated Types
type BuiltinFunction: Clone + Debug + Finalize + Trace
The type of a function implemented by the runtime.
type Expr: Clone + Debug + Finalize + Trace
The type of an expression in the AST.
type ObjectVtable: Clone + Debug + Finalize + Trace
The type of the vtable of an object.
type UserFunction: Clone + Debug + Finalize + Trace
The type of a user function. This probably should just be the
arguments (as an Args<C>
), the body (as C::Expr
), and the variables
closed over and their values (as a GcLinkedList<(Symbol, Value<C>)>
).
type ValueMeta: Clone + Debug + Default + Finalize + Trace
The metadata attached to the value.
Required Methods
fn from_expr(expr: Gc<Expr<Self>>) -> Gc<Self::Expr>
Converts a standard ast::Expr
to the expression type of the context.
Implementors
impl Context for NullContext type BuiltinFunction = GcVoid; type Expr = Expr<Self>; type ObjectVtable = GcVoid; type UserFunction = GcVoid; type ValueMeta = ();