From: Andreas Fuchs Date: Thu, 27 Sep 2007 19:25:25 +0000 (+0000) Subject: 1.0.10.11: Make FEATUREP accept only symbols or conses. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=fbe3701ca881999e1b17ad35f11d3b2c6b66bf99;p=sbcl.git 1.0.10.11: Make FEATUREP accept only symbols or conses. One more restriction on feature expressions: They can contain only conses or symbols. The previous implementation allowed conses and atoms. --- diff --git a/src/code/early-extensions.lisp b/src/code/early-extensions.lisp index 65f98d7..68cf7c5 100644 --- a/src/code/early-extensions.lisp +++ b/src/code/early-extensions.lisp @@ -920,23 +920,24 @@ (def-constantly-fun constantly-nil nil) (def-constantly-fun constantly-0 0)) -;;; If X is an atom, see whether it is present in *FEATURES*. Also +;;; If X is a symbol, see whether it is present in *FEATURES*. Also ;;; handle arbitrary combinations of atoms using NOT, AND, OR. (defun featurep (x) - (if (consp x) - (case (car x) - ((:not not) - (cond - ((cddr x) - (error "too many subexpressions in feature expression: ~S" x)) - ((null (cdr x)) - (error "too few subexpressions in feature expression: ~S" x)) - (t (not (featurep (cadr x)))))) - ((:and and) (every #'featurep (cdr x))) - ((:or or) (some #'featurep (cdr x))) - (t - (error "unknown operator in feature expression: ~S." x))) - (not (null (memq x *features*))))) + (etypecase x + (cons + (case (car x) + ((:not not) + (cond + ((cddr x) + (error "too many subexpressions in feature expression: ~S" x)) + ((null (cdr x)) + (error "too few subexpressions in feature expression: ~S" x)) + (t (not (featurep (cadr x)))))) + ((:and and) (every #'featurep (cdr x))) + ((:or or) (some #'featurep (cdr x))) + (t + (error "unknown operator in feature expression: ~S." x)))) + (symbol (not (null (memq x *features*)))))) ;;;; utilities for two-VALUES predicates diff --git a/version.lisp-expr b/version.lisp-expr index 8758dac..1558149 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.10.10" +"1.0.10.11"