cl-ast: Add inline closure expressions
This commit is contained in:
@@ -295,6 +295,7 @@ impl Interpret for ExprKind {
|
||||
fn interpret(&self, env: &mut Environment) -> IResult<ConValue> {
|
||||
match self {
|
||||
ExprKind::Empty => Ok(ConValue::Empty),
|
||||
ExprKind::Closure(v) => v.interpret(env),
|
||||
ExprKind::Quote(q) => q.interpret(env),
|
||||
ExprKind::Let(v) => v.interpret(env),
|
||||
ExprKind::Match(v) => v.interpret(env),
|
||||
@@ -324,6 +325,14 @@ impl Interpret for ExprKind {
|
||||
}
|
||||
}
|
||||
|
||||
impl Interpret for Closure {
|
||||
fn interpret(&self, env: &mut Environment) -> IResult<ConValue> {
|
||||
Ok(ConValue::Closure(
|
||||
crate::closure::Closure::new(env, self).into(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
impl Interpret for Quote {
|
||||
fn interpret(&self, _env: &mut Environment) -> IResult<ConValue> {
|
||||
// TODO: squoosh down into a ConValue?
|
||||
|
||||
Reference in New Issue
Block a user