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

Issue DEFCONSTANT-NOT-WIRED



   Date: Fri, 7 Oct 88 17:41 EDT
   From: Brad Miller <miller@CS.ROCHESTER.EDU>
   Sender: miller@CS.ROCHESTER.EDU
   Reply-To: miller@CS.ROCHESTER.EDU
   Organization: University of Rochester, Department of Computer Science
   Postal-Address: 610 CS Building, Comp Sci Dept., U. Rochester, Rochester NY 14627
   Phone: 716-275-1118

       Date: Fri, 7 Oct 88 12:52:34 pdt
       From: Eric Benson <eb@lucid.com>

       I disagree.  You may not remember, but DEFPARAMETER was defined to be
       equivalent to Zetalisp's DEFCONST.  DEFCONST was always used to denote
       values that would "never" change, even though the compiler was not
       licensed to substitute their values.  After the Common Lisp version of
       DEFCONSTANT was accepted, DEFPARAMETER was proposed to be used in
       place of DEFCONST in cases where DEFCONSTANT isn't desirable.  As it
       turns out, most uses of DEFCONST have been converted to DEFCONSTANT,
       so DEFPARAMETER has been a bit neglected.

   I use DEFCONSTANT for symbols whose definitions will never change (or at
   least, I am willing to recompile all references, as if I change a macro) but
   DEFPARAMETER for cases where the definitions will not change *over a
   particular execution of the program* but may change *between executions of
   the program* and thus the compiler must treat it as a variable, so I don't
   have to recompile references.

   Have I missed something? Am I misusing DEFPARAMETER?

Perhaps.  Do you consider this "a change *to* the program" as stated
in CLtL?  If you only ever change it at the top level, for example,
you're probably working in the spirit of DEFPARAMETER.  Would you need
to change your program to use DEFVAR instead of DEFPARAMETER if a
warning was signalled every time a variable defined with DEFPARAMETER
is SETQed (as opposed to re-evaluating the DEFPARAMETER form with a
different initial value)?