emacs-devel
[Top][All Lists]
Advanced

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

Re: Real constants


From: Stefan Monnier
Subject: Re: Real constants
Date: Wed, 13 Jul 2005 14:14:45 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> This is *not* a proposed change for 22.1; more of a question about a
> feature, or lack of it.

> Having the possibility of marking a symbol as constant (not in the
> `defconst' sense, but really constant) seems so potentially useful and
> so trivial to implement (vide the attached patch), that I can only
> suppose there's some reason, or perceived problem, not to have done it
> till now.

> Could someone please explain the rationale for not having true
> constants in elisp?

I believe it's mostly because it wasn't nearly as trivial/cheap until Gerd
installed his defvaralias patch, which also introduced the `constant' field
in symbols.

Among the local patches I use, I've expanded this `constant' field to
2 bits, so it can be either hard-read-only or soft-read-only (or writable,
of course).  The soft-read-only state is used by defconst so that variables
defined by defconst cannot be setq but can be changed via defconst
(important when you reload a new version of a package where a defconst was
changed).

Making defconst variables into constants introduces a few occasional
problems with some packages, of course, but nothing too hard to fix.


        Stefan




reply via email to

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