From b1f281e88a633773465b0db89dba7cf885be0549 Mon Sep 17 00:00:00 2001 From: pfdietz Date: Sat, 12 Oct 2002 18:42:14 +0000 Subject: [PATCH] Added tests for SPECIAL-OPERATOR-P --- ansi-tests/cl-symbols.lsp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/ansi-tests/cl-symbols.lsp b/ansi-tests/cl-symbols.lsp index 3d24646..1fde8ac 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 -- GitLab