Martin Simmons writes:
On Mon, 13 Sep 2004 09:14:19 +0200, "Pascal J.Bourguignon" pjb@informatimago.com said:
Pascal> Peter Seibel writes:
- figure out how to distinguish between a defvar/defparameter and defcontstant symbol.
Pascal> This should be implementation dependant.
How about CONSTANTP?
Pascal> CONSTANTP does not do what you think!
Pascal> [22]> (defvar x 1) Pascal> X Pascal> [23]> (defvar c 1) Pascal> C
Ooooops. I thought really very strongly DEFCONSTANT, but I forgot to activate the telephatic module of my computer :-(
[32]> (defconstant c 1) C [33]> (constantp 'c) T [34]> (constantp 'x) NIL
Is the above really the output from a running Common Lisp, with CONSTANTP returning both T and NIL for the symbol X? Was C supposed to be DEFCONTSTANT?
Maybe you didn't type what you think :-)
Indeed. Sorry. So CONSTANTP can be used.