summaryrefslogtreecommitdiff
path: root/control-flow.lisp
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-03 19:19:14 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-03 19:19:14 +0200
commitd4cf5048245695c2a9a72a3ab446472a4afaa56e (patch)
treed55f0fee3bfb4e103607eec2849332e251f482d1 /control-flow.lisp
parent930a4cef72c1b3798edbd7f3a91ee79a5cbb14ad (diff)
Add MULTIPLE-VALUE-PROG1 and VALUES-LIST.
Diffstat (limited to 'control-flow.lisp')
-rw-r--r--control-flow.lisp12
1 files changed, 11 insertions, 1 deletions
diff --git a/control-flow.lisp b/control-flow.lisp
index 56a1542..75ed06c 100644
--- a/control-flow.lisp
+++ b/control-flow.lisp
@@ -20,7 +20,8 @@
(export '(identity constantly complement tagbody go block return-from
return defconstant prog prog* macrolet flet prog1 prog2 labels
- multiple-value-bind multiple-value-list multiple-value-setq))
+ multiple-value-bind multiple-value-list multiple-value-setq
+ multiple-value-prog1 values-list))
(defun identity (x)
@@ -226,3 +227,12 @@
`(destructuring-bind ,syms (multiple-value-list ,expression)
(setq ,@(mapcan #'list vars syms))
,(first syms))))
+
+(defmacro multiple-value-prog1 (form &body forms)
+ (let ((varsym (gensym)))
+ `(let ((,varsym (multiple-value-list ,form)))
+ ,@forms
+ (values-list ,varsym))))
+
+(defun values-list (list)
+ (apply #'values list))