[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: Guy.Steele@CMU-CS-A
- Date: Wed, 08 Jun 1983 05:46:00 -0000
- Cc: common-lisp@SU-AI
- In-reply-to: "Bernard S. Greenberg's message of 7 Jun 83 12:21-EST"
The initial-value form to DEFCONSTANT is conceptually evaluated at load
time. DEFCONSTANT is an invitation to the compiler to susbtitute the
value for occurrences of the constant *if* the compiler is smart enough
to do so. DEFCONSTANT is not meant to side-effect the compiler's environment.
(DEFCONSTANT FOO 3)
(DEFCONSTANT BAR (+ FOO 6))
entitles the compiler to use the value 9 for BAR provided that it is
smart enough to analyze what it going on (actually notall that hard:
the first declaration entitles the compiler to substitute 3 for FOO,
whereupon some simple constant folding reduces (+ 3 6) to 9).
--Guy