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]
impl MacroEnv
pub fn new() -> MacroEnv
[src]
pub fn new() -> MacroEnv
Creates a new MacroEnv
pub fn insert<M>(&self, name: String, mac: M) where
M: Macro + 'static,
[src]
pub fn insert<M>(&self, name: String, mac: M) where
M: Macro + 'static,
Inserts a Macro
which acts on any occurance of symbol
when applied to an expression.
pub fn get(&self, name: &str) -> Option<Arc<Macro>>
[src]
pub fn get(&self, name: &str) -> Option<Arc<Macro>>
Retrieves the macro bound to symbol
pub fn run(
&self,
vm: &Thread,
expr: &mut SpannedExpr<Symbol>
) -> Result<(), Errors>
[src]
pub fn run(
&self,
vm: &Thread,
expr: &mut SpannedExpr<Symbol>
) -> Result<(), Errors>
Runs the macros in this MacroEnv
on expr
using env
as the context of the expansion