[alexandria-devel] [PATCH] fix featurep

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


The attached patch makes FEATUREP accept any compound test specifier,
not just the keywords :AND, :OR and :NOT .

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
-------------- next part --------------
diff -rN -u old-alexandria/alexandria.asd new-alexandria/alexandria.asd
--- old-alexandria/alexandria.asd	2008-02-09 18:50:32.000000000 +0100
+++ new-alexandria/alexandria.asd	2008-02-09 18:50:32.000000000 +0100
@@ -19,4 +19,4 @@
    (:file "lists" :depends-on ("package" "functions"))
    (:file "sequences" :depends-on ("package" "lists"))
    (:file "numbers" :depends-on ("package" "sequences"))
-   (:file "features" :depends-on ("package"))))
+   (:file "features" :depends-on ("package" "control-flow"))))
diff -rN -u old-alexandria/features.lisp new-alexandria/features.lisp
--- old-alexandria/features.lisp	2008-02-09 18:50:32.000000000 +0100
+++ new-alexandria/features.lisp	2008-02-09 18:50:32.000000000 +0100
@@ -6,7 +6,8 @@
 or list acceptable to the reader macros #+ and #-."
   (etypecase feature-expression
     (symbol (not (null (member feature-expression *features*))))
-    (cons (ecase (first feature-expression)
+    (cons (check-type (first feature-expression) symbol)
+          (switch ((first feature-expression) :test 'string=)
             (:and (every #'featurep (rest feature-expression)))
             (:or  (some #'featurep (rest feature-expression)))
             (:not (not (featurep (cadr feature-expression))))))))

-------------- 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/aad30865/attachment.sig>


More information about the alexandria-devel mailing list