pub struct Macro {
pub params: Vec<Spur>,
pub rest_param: Option<Spur>,
pub body: Vec<Value>,
pub name: Spur,
pub syntax_rules: Option<Rc<SyntaxRules>>,
}Expand description
A macro definition.
A procedural defmacro uses params/rest_param/body and leaves
syntax_rules as None. An R7RS (define-syntax name (syntax-rules ...))
leaves the procedural fields empty and carries its transformer in
syntax_rules. Both share TAG_MACRO so env lookup, display, and GC
tracing treat them uniformly.
Fields§
§params: Vec<Spur>§rest_param: Option<Spur>§body: Vec<Value>§name: Spur§syntax_rules: Option<Rc<SyntaxRules>>Some for a syntax-rules transformer; None for procedural macros.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Macro
impl !Sync for Macro
impl Freeze for Macro
impl RefUnwindSafe for Macro
impl Unpin for Macro
impl UnsafeUnpin for Macro
impl UnwindSafe for Macro
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more