Struct gluon_vm::macros::MacroEnv
[−]
[src]
pub struct MacroEnv { /* fields omitted */ }
Type containing macros bound to symbols which can be applied on an AST expression to transform it.
Methods
impl MacroEnv
[src]
fn new() -> MacroEnv
[src]
Creates a new MacroEnv
fn insert<M>(&self, name: String, mac: M) where
M: Macro + 'static,
[src]
M: Macro + 'static,
Inserts a Macro
which acts on any occurance of symbol
when applied to an expression.
fn get(&self, name: &str) -> Option<Arc<Macro>>
[src]
Retrieves the macro bound to symbol
fn run(
&self,
vm: &Thread,
expr: &mut SpannedExpr<Symbol>
) -> Result<(), Errors<Error>>
[src]
&self,
vm: &Thread,
expr: &mut SpannedExpr<Symbol>
) -> Result<(), Errors<Error>>
Runs the macros in this MacroEnv
on expr
using env
as the context of the expansion