diff --git a/src/eval.rs b/src/eval.rs index 60a76d0..1b5cdd1 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -203,7 +203,18 @@ impl Evaluator { (Call(name, args), None) } } - Conditional(box test, then_block, else_block) => unimplemented!(), + Conditional(box test, then_block, else_block) => { + if test.is_reducible() { + let (new_test, new_effect) = self.reduce_expr(test); + (Conditional(Box::new(new_test), then_block, else_block), new_effect) + } else { + if let Number(0.0) = test { + unimplemented!() + } else { + unimplemented!() + } + } + } } }