From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: e and pi Date: Thu, 16 Sep 2010 17:44:45 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1284658340 22060 80.91.229.12 (16 Sep 2010 17:32:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2010 17:32:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 16 19:32:18 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OwIJj-0005kt-I9 for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 19:32:16 +0200 Original-Received: from localhost ([127.0.0.1]:55847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwIJh-000310-38 for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 13:32:13 -0400 Original-Received: from [140.186.70.92] (port=33881 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwHf1-0002s6-Rr for emacs-devel@gnu.org; Thu, 16 Sep 2010 12:50:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwGdk-0001vD-PP for emacs-devel@gnu.org; Thu, 16 Sep 2010 11:44:49 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:37954) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwGdk-0001v9-Mg for emacs-devel@gnu.org; Thu, 16 Sep 2010 11:44:48 -0400 Original-Received: from 71.red-88-9-45.dynamicip.rima-tde.net ([88.9.45.71]:50928 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OwGe3-0005MS-AU; Thu, 16 Sep 2010 11:45:07 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 1636166289; Thu, 16 Sep 2010 17:44:45 +0200 (CEST) In-Reply-To: (Helmut Eller's message of "Thu, 16 Sep 2010 16:27:30 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130257 Archived-At: >> - 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