From d4cf5048245695c2a9a72a3ab446472a4afaa56e Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 3 Aug 2008 19:19:14 +0200 Subject: Add MULTIPLE-VALUE-PROG1 and VALUES-LIST. --- control-flow.lisp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3