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

Re: DEFCONSTANT



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