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: e and pi Date: Thu, 16 Sep 2010 15:25:57 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1284643584 10655 80.91.229.12 (16 Sep 2010 13:26:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2010 13:26:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 16 15:26:20 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 1OwETh-00012F-Hi for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 15:26:17 +0200 Original-Received: from localhost ([127.0.0.1]:47958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwETg-0008Do-Vn for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 09:26:16 -0400 Original-Received: from [140.186.70.92] (port=42090 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwETW-00089k-KZ for emacs-devel@gnu.org; Thu, 16 Sep 2010 09:26:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwETQ-00082X-Gi for emacs-devel@gnu.org; Thu, 16 Sep 2010 09:26:06 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:42970) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwETQ-00082T-D2 for emacs-devel@gnu.org; Thu, 16 Sep 2010 09:26:00 -0400 Original-Received: from 71.red-88-9-45.dynamicip.rima-tde.net ([88.9.45.71]:40541 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 1OwETj-0000qM-4N; Thu, 16 Sep 2010 09:26:19 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0753866289; Thu, 16 Sep 2010 15:25:57 +0200 (CEST) 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:130252 Archived-At: As you may have noticed, I have added a new warning to the byte-compiler for defvars of variables that don't have a prefix. This is in preparation for the introduction of lexical scoping: in order not to have to rewrite all the code, the lexbind branch uses `let' both for dynamically-scoped let-bindings and for lexically-scoped let-bindings; where the distinction is based on whether or not a variable has been defvar'd. This is the same system as used in Common-Lisp and it works well in practice, but it requires a bit of care, because every defvar has a global effect: it declares that this variable will use dynamic-scoping wherever it gets let-bound. So if a file uses `len' as a lexically-scoped variable and another file does a (defvar len), we get a conflict that results in the first file being evaluated with a different semantic than expected by the author. So, the end result is that (defvar -) is OK because the "-" ensures you only mess with your own variable, but (defvar ) is not OK because you may interfere with some other package. Now, we have a lot of offending (defvar ) in Emacs currently, so we will want to fix them, and to get things started, we want to fix the two predefined float constants `e' and `pi'. 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 )) ...) 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? Stefan