From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: In CVS Emacs, calc-eval gives multiplication higher precidence than division Date: Tue, 09 Sep 2008 19:03:36 +0200 Message-ID: <48C6AC68.2060506@gmail.com> References: <878wu3j4k2.fsf@gmail.com> <86wshn3df0.fsf@blue.stonehenge.com> <7D0B0AA3-AED7-456B-AAAB-D72CABD19CFB@gmail.com> <48C58D7B.1060707@gmail.com> <86k5dmxtaz.fsf@blue.stonehenge.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220979915 2567 80.91.229.12 (9 Sep 2008 17:05:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Sep 2008 17:05:15 +0000 (UTC) Cc: Carsten Dominik , emacs-devel@gnu.org, rms@gnu.org, "Randal L. Schwartz" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 09 19:06:09 2008 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 1Kd6ek-0006f3-PB for ged-emacs-devel@m.gmane.org; Tue, 09 Sep 2008 19:05:49 +0200 Original-Received: from localhost ([127.0.0.1]:47822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd6dk-0004U4-S1 for ged-emacs-devel@m.gmane.org; Tue, 09 Sep 2008 13:04:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kd6dA-0003wW-Dj for emacs-devel@gnu.org; Tue, 09 Sep 2008 13:03:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kd6d8-0003v0-KL for emacs-devel@gnu.org; Tue, 09 Sep 2008 13:03:55 -0400 Original-Received: from [199.232.76.173] (port=51926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd6d8-0003uu-GC for emacs-devel@gnu.org; Tue, 09 Sep 2008 13:03:54 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:55618) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kd6d5-0007ja-4P; Tue, 09 Sep 2008 13:03:51 -0400 Original-Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:64927 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Kd6d2-0002w4-6M; Tue, 09 Sep 2008 19:03:49 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-Enigmail-Version: 0.95.7 X-Antivirus: avast! (VPS 080908-0, 2008-09-08), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-ACL-Warn: Too high rate of unknown addresses received from you X-Scan-Result: No virus found in message 1Kd6d2-0002w4-6M. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1Kd6d2-0002w4-6M 9a858b573e71ece77d778f99a0fc7394 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:103737 Archived-At: Stefan Monnier wrote: >> What Calc does now is clearly correct. > > And we clearly disagree. On way of getting out of this trouble would perhaps be to distinguish between an explicit and an implicit `*'. In the explicit case the normal precedence rules should be used, but in the implicit case the current precedence rules might be used instead. The basis for this would be that way allude on the common formula notation. Doing this then 8 / 2 * 2 = (8 / 2) * 2 = 8 and 8 / 2 2 => 8 / (2 * 2) = 2 The first example above follow normal math syntax and semantics. The second example is rather close to what is often used in formulas, like ax/by + cz => (a * x) / (b * y) + c * z Normally this kind of syntax is of course used in a well defined context where you want a short notation for formulas. But it looks like Calc has been striving towards the second in an attempt to make it easier to enter data. I don't think that this is a bad idea. The goal to make it easier to enter data have been reach, but unfortunately a by product has been that Calc mixes the two common cases of syntax/semantics that are most widely used as far as I know. However in my opinion distinguishing the cases like above might be a good solution.