Skip to content
Snippets Groups Projects
Commit 3ab7c63b authored by ram's avatar ram
Browse files

Changed FEATUREP to barf if it is passed a list form with a strange CAR.

parent bf87ecad
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/misc.lisp,v 1.12 1991/12/20 15:34:06 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/misc.lisp,v 1.13 1992/01/17 16:11:49 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -69,14 +69,14 @@ ...@@ -69,14 +69,14 @@
(defun featurep (x) (defun featurep (x)
"If X is an atom, see if it is present in *FEATURES*. Also "If X is an atom, see if it is present in *FEATURES*. Also
handle arbitrary combinations of atoms using NOT, AND, OR." handle arbitrary combinations of atoms using NOT, AND, OR."
(cond ((atom x) (memq x *features*)) (if (consp x)
((eq (car x) ':not) (not (featurep (cadr x)))) (case (car x)
((eq (car x) ':and) (:not (not (featurep (cadr x))))
(every #'featurep (cdr x))) (:and (every #'featurep (cdr x)))
((eq (car x) ':or) (:or (some #'featurep (cdr x)))
(some #'featurep (cdr x))) (t
(t nil))) (error "Unknown operator in feature expression: ~S." x)))
(not (null (memq x *features*)))))
;;; Other Environment Inquiries. ;;; Other Environment Inquiries.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment