summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2013-07-18 15:35:48 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2013-07-18 15:35:48 +0200
commitfdaa36165c5ca1dcd13146dd0b538ec082032068 (patch)
treeef712f5a90633f6cc76408debe1445a847889693
parent74d4efcf5a8c527a19b2771c550efaa03d417985 (diff)
PREPARE-PROGN: Support multiple values.
-rw-r--r--sb-eval2.lisp12
1 files changed, 8 insertions, 4 deletions
diff --git a/sb-eval2.lisp b/sb-eval2.lisp
index 7be5627..b68591e 100644
--- a/sb-eval2.lisp
+++ b/sb-eval2.lisp
@@ -307,10 +307,14 @@
(declaim (ftype (function (list context) eval-closure) prepare-progn))
(defun prepare-progn (forms context)
(let ((body* (mapcar (lambda (form) (prepare-form form context)) forms)))
- (lambda (env)
- (let (result)
- (dolist (form* body* result)
- (setq result (funcall (the eval-closure form*) env)))))))
+ (if (null body*)
+ (prepare-nil)
+ (let ((forms* (butlast body*))
+ (last-form* (first (last body*))))
+ (lambda (env)
+ (dolist (form* forms*)
+ (funcall (funcall (the eval-closure form*) env)))
+ (funcall (the eval-closure last-form*) env))))))
(defun lambda-binding-vars (entry)
(etypecase entry