Re: Is DEFCONSTANT broken?



On Jun 22, 6:46 pm, Ron Garret <rNOSPA...@xxxxxxxxxxx> wrote:
In article <20090704083602....@xxxxxxxxx>,
 Kaz Kylheku <kkylh...@xxxxxxxxx> wrote:

  (eval-when (:load-toplevel)
    (define-symbol-macro c7 (c7)))

See: two different definitions for diferent situations, creating the
illusion of one consistent constant.

That works insofar as (eq c7 (c7)) returns T.  However, it's not really
what I want.  The main reason I want to use DEFCONSTANT is to prevent c7
from being reassigned or rebound.  If C7 is a symbol macro I don't get
that guarantee.  If I were willing to rely on the user not to assign or
bind c7 I could just use DEFVAR and be done with it.

Yeah, oh well.

To address your larger point, yes, I have long thought DEFCONSTANT is
not as useful as its inventor(s) probably hoped.

-- Scott
.



Relevant Pages

  • Re: Is DEFCONSTANT broken?
    ... | The main reason I want to use DEFCONSTANT is to prevent c7 from being ... | reassigned or rebound. ... supposed to be the programmable programming language? ...
    (comp.lang.lisp)
  • Re: Is DEFCONSTANT broken?
    ...  The main reason I want to use DEFCONSTANT is to prevent c7 ... from being reassigned or rebound. ... To address your larger point, yes, I have long thought DEFCONSTANT is ... If you want a language that provides you ...
    (comp.lang.lisp)