[Top][All Lists]

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

Re: e and pi

From: Helmut Eller
Subject: Re: e and pi
Date: Thu, 16 Sep 2010 16:27:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

* Stefan Monnier [2010-09-16 13:25] writes:

> In their case, the solution is to rename them to `float-e' and
> `float-pi', but this introduces a backward incompatibility.
> I figure we could define-obsolete-variable-alias (which leaves the
> problem of `e' and `pi' being dynamically scoped, but hopefully only
> for a few versions until we remove the obsolete name), but this means
> that every code that does (let ((e <foo>)) ...) would now get a stupid
> warning about using an obsolete variable `e'.
> So I intend to do the following:
> - 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).

So (let ((e <foo>)) e) would be legal, but it binds a lexical local
variable and not the dynamic variable.  Functions called in the dynamic
scope would not "see" the lexical binding and would use the global

A possible problem are macros that assume that e is a true constant and
never rebound.  That seems rare for e but would be a real problem for t.


reply via email to

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