help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Working with constansts


From: Decebal
Subject: Re: Working with constansts
Date: Mon, 11 May 2009 01:27:03 -0700 (PDT)
User-agent: G2/1.0

On May 10, 6:19 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> Decebal <CLDWester...@gmail.com> writes:
> > I would like to work with constants in my elisp code. I thought that I
> > could do this with defconst, but that doen not work.
> > After:
> >     (defconst dummy "testing")
> > The variable dummy has the value "testing".
> > But after:
> >     (setq dummy "changed")
> > The variable dummy has the value "changed".
> > What am I doing wrong.
>
> You're still thinking that constants don't change or that variables do.
>
> If you don't want to change the value of a constant, then don't change it.

But if I make a library and distribute it, the receiver could -
unwittingly- change it. But the idea of using '+' to put before and
after the variable name is a good one. I'll do that.

By the way: you can only change sources if you have them. ;-]
Also: changing a source and recompiling is a little bit more obvious -
also for the person doing it- as a setq.

But my understanding of elisp has been amended. That never hurts.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]