diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2013-07-18 15:35:48 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2013-07-18 15:35:48 +0200 |
commit | fdaa36165c5ca1dcd13146dd0b538ec082032068 (patch) | |
tree | ef712f5a90633f6cc76408debe1445a847889693 | |
parent | 74d4efcf5a8c527a19b2771c550efaa03d417985 (diff) |
PREPARE-PROGN: Support multiple values.
-rw-r--r-- | sb-eval2.lisp | 12 |
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 |