Commit 7fb62252 authored by Attila Lendvai's avatar Attila Lendvai

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

Patch by Stelian Ionescu.
parent 57a89c44
......@@ -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"))))
......@@ -6,7 +6,9 @@ list and NIL if it does not. FEATURE-EXPRESSION can be any atom
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)
(eswitch ((first feature-expression) :test 'string=)
(:and (every #'featurep (rest feature-expression)))
(:or (some #'featurep (rest feature-expression)))
(:not (not (featurep (cadr feature-expression))))))))
(:not (assert (= 2 (length feature-expression)))
(not (featurep (second feature-expression))))))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment