summaryrefslogtreecommitdiff
path: root/lisp.y
diff options
context:
space:
mode:
authorFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-22 13:42:34 +0100
committerFelix Perktold <Felix.Perktold@student.uibk.ac.at>2026-01-22 13:42:34 +0100
commita31d9092201d6e9fefde7403b19ed93512aa6b47 (patch)
tree804281f58c43a24b40d7626380241a23367d5ff1 /lisp.y
parenteaa0ad227969429b333d6ef26e4f4c9f266fbee5 (diff)
lambdas now eval whole body and return the last element of the body instead of just evaluating and returnin the first element
Diffstat (limited to 'lisp.y')
-rw-r--r--lisp.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp.y b/lisp.y
index 504e50f..2ed97bf 100644
--- a/lisp.y
+++ b/lisp.y
@@ -16,8 +16,9 @@ void eval_and_print_REPL(value *v) {
println_value(car(cdr(v)));
return; // Skip printing for define so infinite lists do not eval
}
+ value *evaled = eval(global_env, v);
printf(";> ");
- println_value(eval(global_env, v));
+ println_value(evaled);
}
%}