Stelian Ionescu | 9 Feb 19:02 2008
Picon

[PATCH] fix featurep

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.
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
 <at>  <at>  -19,4 +19,4  <at>  <at> 
    (: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
 <at>  <at>  -6,7 +6,8  <at>  <at> 
 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))))))))

_______________________________________________
alexandria-devel mailing list
alexandria-devel <at> common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/alexandria-devel

Gmane