gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] functionp.4 (ansi-tests)??


From: Peter Wood
Subject: [Gcl-devel] functionp.4 (ansi-tests)??
Date: Mon, 16 Dec 2002 20:17:34 +0100
User-agent: Mutt/1.4i

Hi

In ansi-tests/functionp.lsp, this test is in error:

(deftest functionp.4
  (loop for x in *cl-symbol-names*
        for s = (find-symbol x "CL")
        for f = (and (fboundp s) (symbol-function s)
                     (not (special-operator-p s))
                     (not (macro-function s)))
        always (or (null f)
                   (functionp f)))
  t)


In a compliant implementation, f can either be T or NIL (or, strictly,
NIL or (not NIL)). 

Eg, for s = 'car, 
-----------------
(fboundp s) ==> T
(symbol-function s) ==> function object (ie, NOT NIL)
(not (special-operator-p s)) ==> T
(not (macro-function s)) ==> T

(and T (NOT NIL) T T) ==> T

so f = T
---------
(null f) ==> NIL
(functionp f) ==> NIL

(or NIL NIL) ==> NIL

and 'always' is FALSE.

In addition, Both fboundp[1] and symbol-function[2] return something
which is not NIL for functions, macros and special-operators (see the
entries for these fns), and ditto for the next two, _wrt_ macros and
special-operators.[3]

Regards,
Peter

(I haven't looked closely, but I think similar objections can be
raised against test function.4)


[1]"The names of macros and special operators are fbound, but the
nature and type of the object which is their value is
implementation-dependent." HS glossary entry for fbound.

[2]"If the symbol is globally defined as a macro or a special
operator, an object of implementation-dependent nature and identity is
returned." HS entry for symbol-function function.

[3]"It is possible for both macro-function and special-operator-p to
return true of [a] symbol" HS entry for special-operator-p



reply via email to

[Prev in Thread] Current Thread [Next in Thread]