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

Re: Is CONSTANTP ever required to return true?



> Anyone know if ANSI has clarified this?

Yes.  See X3J13 proposal CONSTANTP-DEFINITION (passed 3/91) or the definition of 
CONSTANTP in the dpANS for Common Lisp, p.3-101.

The latter says that each of the following *must* be recognized as constants by 
CONSTANTP:

 * \term{self-evaluating objects}

 * \term{constant variables} such as \term{keywords}, symbols defined by CL to be 
   constants (such as NIL, T, and PI), and symbols declared as constant in the 
   indicated environment by the use of DEFCONSTANT.

 * QUOTE \term{forms}.

In addition, an implementation is permitted to return true for CONSTANTP for 
other forms, with some constraints stated in the X3J13 proposal that I don't see 
in the draft.

By the way, I know of no implementation for which CONSTANTP returns false for any 
of the bulleted items.