emacs-devel
[Top][All Lists]
Advanced

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

Re: e and pi


From: Stefan Monnier
Subject: Re: e and pi
Date: Thu, 16 Sep 2010 17:44:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> - in Emacs-23.3, define `e', `float-e', `pi', and `float-pi' and declare
>> `e' and `pi' obsolete, but without a make-obsolete-variable
>> (i.e. only in NEWS and in docstrings).
>> - in Emacs-24 keep float-e and float-pi but get rid of `e' and `pi'.
>> Can anyone think of a better solution?

> Lexically scoped constants.  I mean 
> (defconstant e ...)
> could declare that e is lexically scoped (but has a global binding).

Indeed, `pi' is a defconst and currently `e' is a defvar but wants to be
a defconst as well.  And indeed if `defconst' really defines a constant,
then it can be considered as a lexically scoped variable.

But such a convention would introduce a lot more breakage, since many
packages still use defconst for variables which they later on modify via
`let' or `setq', expecting dynamic scoping semantics.  Admittedly, such
packages should be getting more rare since I've added warnings in the
byte-compiler in Emacs-23 (or maybe even Emacs-22?) about setq and let
applied to defconst'd vars.

Still, I think this is more dangerous than renaming e and pi (which are
admittedly very rarely used).

OTOH maybe you meant to introduce a new `defconstant' that's like
`defconst' except that it declares the var as lexically scoped.
Hmm... I guess that could work.


        Stefan



reply via email to

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