[slime-devel] Re: the slime inspector

Martin Simmons martin at xanalys.com
Mon Sep 13 10:10:48 UTC 2004


>>>>> On Mon, 13 Sep 2004 09:14:19 +0200, "Pascal J.Bourguignon" <pjb at 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
  Pascal> [24]> (constantp c)
  Pascal> T
  Pascal> [25]> (constantp c)
  Pascal> T
  Pascal> [26]> (constantp 'x)
  Pascal> T
  Pascal> [27]> (constantp 'x)
  Pascal> NIL
  Pascal> [28]> (constantp 'c)
  Pascal> NIL
  Pascal> [29]> (constantp #(1 2 3))
  Pascal> T
  Pascal> [30]> (constantp '(1 2 3))
  Pascal> NIL
  Pascal> [31]> (constantp (list 1 2 3))
  Pascal> NIL

  Pascal> CONSTANTP could be useful when writting a macro or a compiler macro,
  Pascal> but that's about all.

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 :-)

__Martin




More information about the slime-devel mailing list