diff --git a/ansi-tests/function.lsp b/ansi-tests/function.lsp new file mode 100644 index 0000000000000000000000000000000000000000..48a49b7c1be910c84597b07730af6a8d734829fa --- /dev/null +++ b/ansi-tests/function.lsp @@ -0,0 +1,68 @@ +;-*- Mode: Lisp -*- +;;;; Author: Paul Dietz +;;;; Created: Mon Oct 7 07:34:29 2002 +;;;; Contains: Tests for type FUNCTION + +(in-package :cl-test) + +;;; +;;; Note! There are significant incompatibilities between CLTL1 and ANSI CL +;;; in the meaning of FUNCTION and FUNCTIONP. +;;; + +(deftest function.1 + (typep nil 'function) + nil) + +(deftest function.2 + (typep 'identity 'function) + nil) + +(deftest function.3 + (not (typep #'identity 'function)) + nil) + +(deftest function.4 + (loop for x in *cl-symbol-names* + for s = (find-symbol x "CL") + for f = (and (fboundp s) (symbol-function s)) + always (or (null f) + (typep f 'function) + )) + t) + +(deftest function.5 + (typep '(setf car) 'function) + nil) + +(deftest function.6 + (typep '(lambda (x) x) 'function) + nil) + +(deftest function.7 + (not (typep #'(setf car) 'function)) + nil) + +(deftest function.8 + (not (typep #'(lambda (x) x) 'function)) + nil) + +(deftest function.9 + (not (typep (compile nil '(lambda (x) x)) 'function)) + nil) + +(deftest function.10 + (loop for x in *universe* + never + (and (or (numberp x) (characterp x) (symbolp x) (consp x) + (typep x 'array)) + (typep x 'function))) + t) + +(deftest function.11 + (flet ((%f () nil)) (typep '%f 'function)) + nil) + +(deftest function.12 + (flet ((%f () nil)) (not (typep #'%f 'function))) + nil) \ No newline at end of file diff --git a/ansi-tests/gclload2.lsp b/ansi-tests/gclload2.lsp index cbbf24c472663c2c22a70660161c3d4edb8eea3f..100317ceaa9a255fde7c84f5985a67fcb438e3b2 100644 --- a/ansi-tests/gclload2.lsp +++ b/ansi-tests/gclload2.lsp @@ -8,6 +8,7 @@ (load "constantly.lsp") (load "complement.lsp") (load "setf-apply.lsp") +(load "function.lsp") (load "functionp.lsp") ;;; Tests of conses