[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DEFCONSTANT
- To: Bernard S. Greenberg <BSG%SCRC-TENEX@MIT-MC>
- Subject: Re: DEFCONSTANT
- From: Walter van Roggen <Walter.VanRoggen@CMU-CS-A> (C410WV50)
- Date: Tue, 07 Jun 1983 22:20:00 -0000
- Cc: common-lisp@su-ai
- In-reply-to: "Bernard S. Greenberg's message of 7 Jun 83 12:21-EST"
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