emacs-devel
[Top][All Lists]
Advanced

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

Re: Real constants


From: Juanma Barranquero
Subject: Re: Real constants
Date: Thu, 14 Jul 2005 10:05:27 +0200

On 7/14/05, Stefan Monnier <address@hidden> wrote:

> There's no released Emacs with defvaralias, so it's still recent.

That is true, but seems a joke... :)

> No.  But I could make `defvar' un-const a defconst if that's necessary.

Aha.

> These are hard-read-only so they can't be redefined with defconst
> or un-const'd.

OK.

>   Removing the defvars and replacing the setq with defconst is correct, but
>   the byte-compiler is a bit dumb and don't realize that foo and bar are
>   both unconditionally defined, so it may warn of unknown variables.

In this case you should `defvar' them (to make them known to the
byte-compiler), and then `defconst' them to make unmodifiable. If
there were ever to exist true constants in Emacs (which I see Richard
is vetoing), the ability to switch the constness state would be
necessary.

> - name clashes.  E.g.

The only answer to this would be to make sure constants have
significant, hard-to-repeat-by-accident names. Instead of `e', that
should be `number-e' or `*number-e*' or `transcendent-constant-e' or
whatever.

> I doubt it'll ever make its way into Emacs:

That seems correct.

Thanks,

                    /L/e/k/t/u




reply via email to

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