1041 |
(constantp s)) |
(constantp s)) |
1042 |
(push (list s sym 'not-constant) result))))))) |
(push (list s sym 'not-constant) result))))))) |
1043 |
nil) |
nil) |
1044 |
|
|
1045 |
|
|
1046 |
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1047 |
|
;;; special-operator-p |
1048 |
|
|
1049 |
|
|
1050 |
|
;;; See section 3.1.2.1.2.1 |
1051 |
|
(defconstant +special-operators+ |
1052 |
|
'(block let* return-from catch load-time-value setq eval-when |
1053 |
|
locally symbol-macrolet flet macrolet tagbody function |
1054 |
|
multiple-value-call the go multiple-value-prog1 throw if |
1055 |
|
progn unwind-protect labels progv let quote)) |
1056 |
|
|
1057 |
|
|
1058 |
|
;;; All the symbols in +special-operators+ are special operators |
1059 |
|
(deftest special-operator-p.1 |
1060 |
|
(loop for s in +special-operators+ |
1061 |
|
unless (special-operator-p s) |
1062 |
|
collect s) |
1063 |
|
nil) |
1064 |
|
|
1065 |
|
;;; None of the standard symbols except those in +special-operators+ |
1066 |
|
;;; are special operators |
1067 |
|
(deftest special-operator-p.2 |
1068 |
|
(let ((p (find-package "CL"))) |
1069 |
|
(loop for name in *cl-symbol-names* |
1070 |
|
unless (or (member name +special-operators+ :test #'string=) |
1071 |
|
(not (special-operator-p (find-symbol name p)))) |
1072 |
|
collect name)) |
1073 |
|
nil) |
1074 |
|
|
1075 |
|
(deftest special-operator-p.3 |
1076 |
|
(classify-error (special-operator-p 1)) |
1077 |
|
type-error) |
1078 |
|
|
1079 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1080 |
;;; keywordp |
;;; keywordp |