From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.devel Subject: Re: e and pi Date: Thu, 16 Sep 2010 15:44:05 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1284644740 16424 80.91.229.12 (16 Sep 2010 13:45:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Sep 2010 13:45:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 16 15:45:34 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 1OwEmK-0004h9-7e for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 15:45:33 +0200 Original-Received: from localhost ([127.0.0.1]:47663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwEmI-0006q7-DF for ged-emacs-devel@m.gmane.org; Thu, 16 Sep 2010 09:45:30 -0400 Original-Received: from [140.186.70.92] (port=41990 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwElk-0006bj-TZ for emacs-devel@gnu.org; Thu, 16 Sep 2010 09:44:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwElg-000396-EV for emacs-devel@gnu.org; Thu, 16 Sep 2010 09:44:56 -0400 Original-Received: from mail-px0-f169.google.com ([209.85.212.169]:52462) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwElg-00038U-6Q for emacs-devel@gnu.org; Thu, 16 Sep 2010 09:44:52 -0400 Original-Received: by pxi5 with SMTP id 5so790283pxi.0 for ; Thu, 16 Sep 2010 06:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=jUp5JRmdk78h6I2ZxlyGecQorIiEPoX7OqSnbgZOgAQ=; b=BlWh6kRUFQCecRC8sDPyQuHrRvbSEkwzTUeQgeSYoLT2G+EFvaD5e4j/f6oFMf0h+o TJofvhmE+IDuaTcW3Vdn0n8ewpM2O3+XoR9YYukpJrC8OhWjNZSAjj9NFYocWRAZZx6u fiQK7vc3FKXN4MWF0szEwBkFS9yvYzyxoBWOM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=p2KLqBqcWRSxE58R4+/00H7z/NLZL8xwdV1ppM79BkSaImNxjCnUEmMkctFhWGRjGy PV6swB4Pe8I5/okViNiEvgGUrf2P8vAyGzaqaAfekOV/t476+k/Nl/z3U38PVbQtmuIn hAmcoj8UJS5tNiDVSpqEz+WqBd2UvuyAIOQdo= Original-Received: by 10.114.113.19 with SMTP id l19mr3633546wac.149.1284644682196; Thu, 16 Sep 2010 06:44:42 -0700 (PDT) Original-Received: by 10.220.202.70 with HTTP; Thu, 16 Sep 2010 06:44:05 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:130253 Archived-At: 2010/9/16 Stefan Monnier : > 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. =A0This 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. =A0This 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. =A0So 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 > =A0`e' and `pi' obsolete, but without a make-obsolete-variable > =A0(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? > > > =A0 =A0 =A0 =A0Stefan > > I don't have any ideas for a solution, but I wonder how this will affect libraries that use the foo/bar (non-)convention, e.g. the defvar yas/keymap in yasnippet? --=20 Deniz Dogan