[slime-cvs] CVS slime

CVS User heller heller at common-lisp.net
Wed Jan 26 07:17:51 UTC 2011


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv19156

Modified Files:
	ChangeLog swank.lisp 
Log Message:
Allow tail-merging in call-with-bindings.

* swank.lisp (call-with-bindings): Don't use progv if alist is
empty alist is empty.

--- /project/slime/cvsroot/slime/ChangeLog	2011/01/20 23:34:21	1.2169
+++ /project/slime/cvsroot/slime/ChangeLog	2011/01/26 07:17:50	1.2170
@@ -1,3 +1,10 @@
+2011-01-26  Helmut Eller  <heller at common-lisp.net>
+
+	Allow tail-merging in call-with-bindings.
+
+	* swank.lisp (call-with-bindings): Don't use progv if alist is
+	empty alist is empty.
+
 2011-01-20  Stas Boukarev  <stassats at gmail.com>
 
 	* swank-ecl.lisp (+TAGS+): change
--- /project/slime/cvsroot/slime/swank.lisp	2010/12/09 18:51:17	1.734
+++ /project/slime/cvsroot/slime/swank.lisp	2011/01/26 07:17:51	1.735
@@ -177,11 +177,13 @@
 (defun call-with-bindings (alist fun)
   "Call FUN with variables bound according to ALIST.
 ALIST is a list of the form ((VAR . VAL) ...)."
-  (let* ((rlist (reverse alist))
-         (vars (mapcar #'car rlist))
-         (vals (mapcar #'cdr rlist)))
-    (progv vars vals
-      (funcall fun))))
+  (if (null alist)
+      (funcall fun)
+      (let* ((rlist (reverse alist))
+             (vars (mapcar #'car rlist))
+             (vals (mapcar #'cdr rlist)))
+        (progv vars vals
+          (funcall fun)))))
 
 (defmacro with-bindings (alist &body body)
   "See `call-with-bindings'."





More information about the slime-cvs mailing list