Add "!" syntatic form - a bit like the single quote, but !(a b c) d => !(a b c d). Useful for like !(let a 1) (+ a 3) or w/e. Break out some of the infinate nesting"
This commit is contained in:
@@ -55,5 +55,12 @@ impl Form {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
pub fn append(&self, x: Rc<Form>) -> Option<Form> {
|
||||
match self {
|
||||
Form::Pair(car, cdr) => cdr.append(x).map(|x| Form::Pair(Rc::clone(car), Rc::new(x))),
|
||||
Form::Nil => Some(Form::Pair(x, Rc::new(Form::Nil))),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user