From 1ffbeb6472ba49ca14fcbe3accfdf7bafe09c73f Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 24 Jan 2016 12:10:34 -0800 Subject: [PATCH] Return last value out of function --- src/eval.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/eval.rs b/src/eval.rs index 0e31a68..a658d7b 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -225,11 +225,12 @@ impl Evaluator { } self.frames.push(frame); + let mut retval = Null; for expr in function.body.iter() { - self.reduce_expr(expr.clone()); + retval = self.reduce_expr(expr.clone()); } self.frames.pop(); - Null + retval } }