From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Calc: `*' binds more strongly than `/' Date: Thu, 26 Apr 2007 13:32:36 -0500 (CDT) Message-ID: <200704261832.l3QIWajF026730@jane.dms.auburn.edu> References: <87y7kvxj6p.fsf@arcor.de> <87tzvhcul9.fsf@stupidchicken.com> <863b2z2mma.fsf@blue.stonehenge.com> <55350.128.165.123.18.1176926533.squirrel@webmail.lanl.gov> <86ps5zuwmi.fsf@blue.stonehenge.com> <87ps5zi1h2.fsf@truman.edu> <462C8EA2.9090003@gnu.org> <87ejmbdr1x.fsf@truman.edu> <87d51sqinn.fsf@gmail.com> <87647j93tz.fsf@gmail.com> <39030.128.165.123.18.1177600068.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1177612541 20208 80.91.229.12 (26 Apr 2007 18:35:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2007 18:35:41 +0000 (UTC) Cc: jay.p.belanger@gmail.com, emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 26 20:35:32 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 1Hh8oU-00079h-MF for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2007 20:35:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hh8uF-0002DK-Lk for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2007 14:41:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hh8uB-0002CB-8x for emacs-devel@gnu.org; Thu, 26 Apr 2007 14:41:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hh8u9-0002Bv-JY for emacs-devel@gnu.org; Thu, 26 Apr 2007 14:41:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hh8u9-0002Bs-Ey for emacs-devel@gnu.org; Thu, 26 Apr 2007 14:41:21 -0400 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1Hh8oN-0000kj-HI for emacs-devel@gnu.org; Thu, 26 Apr 2007 14:35:23 -0400 Original-Received: from jane.dms.auburn.edu (jane.dms.auburn.edu [131.204.53.201]) by manatee.dms.auburn.edu (8.13.7+Sun/8.13.7) with ESMTP id l3QIZJSJ009204; Thu, 26 Apr 2007 13:35:19 -0500 (CDT) Original-Received: from jane.dms.auburn.edu (localhost [127.0.0.1]) by jane.dms.auburn.edu (8.13.4+Sun/8.13.4) with ESMTP id l3QIWbwn026733; Thu, 26 Apr 2007 13:32:37 -0500 (CDT) Original-Received: (from teirllm@localhost) by jane.dms.auburn.edu (8.13.4+Sun/8.13.3/Submit) id l3QIWajF026730; Thu, 26 Apr 2007 13:32:36 -0500 (CDT) X-Authentication-Warning: jane.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f In-reply-to: (message from Stefan Monnier on Thu, 26 Apr 2007 12:01:46 -0400) X-detected-kernel: Solaris 10 (beta) 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:70201 Archived-At: Stefan Monnier wrote: > For what it's worth, Mathematica (one of the few other programs with the > "implicit multiplication" operator) gives implicit and explicit > multiplication and division equal precedence: a b/c d puts d in the > numerator, as does a*b/c*d. Hmm... that does come as unintuitive to me. No. Because b/c can be interpreted as an individual rational number, rather than the result of an operation (division). This is especially true when you are using software that implements rational numbers. This is actually one of the main reasons that / usually has precedence over *: a*b/c*d can be considered as `a' times the rational number `b/c' times `d'; / can also be considered as an operation and a,b,c,d as four distinct numbers. If you give / higher precedence as *, you do not have to worry about which interpretation is "correct", since it does not make any difference. 2/3 * 5/7 = 10/21, in either interpretation _assuming_ / has higher precedence than *. Of course, provoking discussions like this is one of the many reasons why the Devil invented infix notation. If you have to use it, then the best way to defeat his brilliant but evil scheme is to always write explicitly (a*b)/(b*c) or a*(b/c)*d, to leave no doubt whatsoever. Sincerely, Luc.