Commit 4d113710 authored by Luis Oliveira's avatar Luis Oliveira

New function: FEATUREP

Added respective documentation in manual as well.
parent d13f04db
......@@ -18,4 +18,5 @@
(:file "functions" :depends-on ("package" "symbols" "macros"))
(:file "lists" :depends-on ("package" "functions"))
(:file "sequences" :depends-on ("package" "lists"))
(:file "numbers" :depends-on ("package" "sequences"))))
(:file "numbers" :depends-on ("package" "sequences"))
(:file "features" :depends-on ("package"))))
......@@ -80,6 +80,7 @@ terms and conditions:
* Array Utilities::
* Type Designator Manipulation::
* Mathematical Utilities::
* Features::
@end menu
@node Top
......@@ -209,4 +210,11 @@ terms and conditions:
@include include/fun-alexandria-variance.texinfo
@include include/fun-alexandria-standard-deviation.texinfo
@c FIXME: get a better section name
@node Features
@comment node-name, next, previous, up
@section Features
@include include/fun-alexandria-featurep.texinfo
@bye
(in-package :alexandria)
(defun featurep (feature-expression)
"Returns T if the argument matches the state of the *FEATURES*
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)
(:and (every #'featurep (rest feature-expression)))
(:or (some #'featurep (rest feature-expression)))
(:not (not (featurep (cadr feature-expression))))))))
......@@ -116,5 +116,4 @@
#:coercef
;; Errors
#:required-argument
#:simple-style-warning
))
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