[alexandria-devel] [PATCH] fix generate-switch-body

Stelian Ionescu sionescu at common-lisp.net
Sat Feb 9 18:04:50 UTC 2008


The attached patch makes GENERATE-SWITCH-BODY extract the function name
of KEY too, not just TEST.

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
-------------- next part --------------
diff -rN -u old-alexandria/control-flow.lisp new-alexandria/control-flow.lisp
--- old-alexandria/control-flow.lisp	2008-02-09 18:33:08.000000000 +0100
+++ new-alexandria/control-flow.lisp	2008-02-09 18:33:08.000000000 +0100
@@ -3,6 +3,7 @@
 (defun generate-switch-body (whole object clauses test key &optional default)
   (with-gensyms (value)
     (setf test (extract-function-name test))
+    (setf key (extract-function-name key))
     (when (and (consp default)
                (member (first default) '(error cerror)))
       (setf default `(, at default "No keys match in SWITCH. Testing against ~S with ~S."

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/alexandria-devel/attachments/20080209/c938b67e/attachment.sig>


More information about the alexandria-devel mailing list