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

Re: DEFCONSTANT



My idea of how DEFCONSTANT should work is similar to how DEFMACRO works.
Each DEFCONSTANT has an implied EVAL-WHEN (COMPILE LOAD EVAL) around it.
For most simple constants, yes, this is like DEFPARAMETER. But we
definitely want to be able to have compile time constants available for
the compiler to optimize on. That means we have to give up some sharing.
For example, 

(defconstant eof-marker '(eof-marker))

(defun foo () eof-marker)
(defun bar () eof-marker)

and now (EQ (FOO) (BAR)) is not necessarily true. I think this is why
we had to rename DEFCONST to DEFCONSTANT. I guess some examples in
the manual would help.

			---Walter