From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: constant `e' Date: 10 Feb 2007 10:02:38 +0100 Message-ID: <20070210101700.GA885@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171098199 28964 80.91.229.12 (10 Feb 2007 09:03:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Feb 2007 09:03:19 +0000 (UTC) Cc: Emacs-Devel To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 10 10:03:15 2007 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.50) id 1HFo8U-0005cF-St for ged-emacs-devel@m.gmane.org; Sat, 10 Feb 2007 10:03:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFo8U-00011w-G1 for ged-emacs-devel@m.gmane.org; Sat, 10 Feb 2007 04:03:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HFo86-0000zK-2s for emacs-devel@gnu.org; Sat, 10 Feb 2007 04:02:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HFo84-0000xH-Kz for emacs-devel@gnu.org; Sat, 10 Feb 2007 04:02:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HFo84-0000xA-G0 for emacs-devel@gnu.org; Sat, 10 Feb 2007 04:02:44 -0500 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HFo83-0004MF-4J for emacs-devel@gnu.org; Sat, 10 Feb 2007 04:02:43 -0500 Original-Received: (qmail 74083 invoked by uid 3782); 10 Feb 2007 09:02:38 -0000 Original-Received: from acm.muc.de (p54A3FC3E.dip.t-dialin.net [84.163.252.62]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 10 Feb 2007 10:02:36 +0100 Original-Received: (qmail 937 invoked by uid 1000); 10 Feb 2007 10:17:00 -0000 Original-Date: Sat, 10 Feb 2007 10:17:00 +0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: FreeBSD 4.6-4.9 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:66202 Archived-At: Hi, Drew! On Thu, Feb 08, 2007 at 11:37:36PM -0800, Drew Adams wrote: > A minor whine - ignore if you don't agree. No such luck! > Single-character global variables are generally not such a great idea. > In particular, they can easily occur as typographical errors and not be > detected for a while. Has this happened to you? > The variable `e', defined in `float-sup.el', has been around for a long > time, but I wonder if it wouldn't be better to give it a different name > in Emacs, because of the possibility of `e' occurring as a typo. e has been around for several hundred years. It is known by that name universally in European language cultures. Anybody who understands its concept instantly recognises its one-letter name, just as any hacker recognises the name C. Has e ever been known to mathematicians by any other name? So no, in my humble opinion, it would not be a good idea to give it a new name. > `t' is similar, of course, but `t' as a typo is less surprising for > anyone at all used to Lisp. `e' as a numerical constant is not used in > most Emacs-Lisp code, so it is more likely that someone might be > surprised by the effect of an `e' typo (once discovered). If e were to be renamed, how would anybody find out it exists? Who would remember the new name? > The position of `e' on many keyboards also makes it easy to hit when > you mean to hit a numeral key such as `3', and, unlike `t', the type of > `e' is numeric, so the value mismatch won't always lead to a type > mismatch that might make the error more apparent. Come on, Drew - post the error you made or came across, please! > There are many other one-letter physical and mathematical constants. > Fortunately, their names are not used as the names of Emacs constants > and variables. `e' seems to be the exception. Even a two-letter name, > such as `pi', is much, much less error prone than a one-letter name. Despite being a maths graduate, I can't think of any other such constants with anything like the universality of e and pi. [ .... ] > The best joke is not that self-referencing comment, but the fun someone > would have trying to find all occurrences of variable `e' in the > existing code, .... Something like "^\([^e;\]\|\\.\|[a-zA-Z_-]e\|e[a-zA-Z_-]\)*e\([^a-zA-Z_-]\|$\)" (fully untested), would find them easily enough. > .... to rename them (and debugging missed or inappropriate renamings). > Undefining it and seeing what happens would be one approach... > Obviously not something to attempt before the release, in any case. ;-) I don't think there would be that many to find. -- Alan Mackenzie (Ittersbach, Germany)