diff --git a/ansi-tests/cl-symbols.lsp b/ansi-tests/cl-symbols.lsp index 3d24646b362d4456da694eb7363a614751e02f5e..1fde8ac5b8bb172a0a58c2acc985cabf546f69d7 100644 --- a/ansi-tests/cl-symbols.lsp +++ b/ansi-tests/cl-symbols.lsp @@ -1041,7 +1041,40 @@ (constantp s)) (push (list s sym 'not-constant) result))))))) nil) - + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; special-operator-p + + +;;; See section 3.1.2.1.2.1 +(defconstant +special-operators+ + '(block let* return-from catch load-time-value setq eval-when + locally symbol-macrolet flet macrolet tagbody function + multiple-value-call the go multiple-value-prog1 throw if + progn unwind-protect labels progv let quote)) + + +;;; All the symbols in +special-operators+ are special operators +(deftest special-operator-p.1 + (loop for s in +special-operators+ + unless (special-operator-p s) + collect s) + nil) + +;;; None of the standard symbols except those in +special-operators+ +;;; are special operators +(deftest special-operator-p.2 + (let ((p (find-package "CL"))) + (loop for name in *cl-symbol-names* + unless (or (member name +special-operators+ :test #'string=) + (not (special-operator-p (find-symbol name p)))) + collect name)) + nil) + +(deftest special-operator-p.3 + (classify-error (special-operator-p 1)) + type-error) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; keywordp