From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christian Schlauer Newsgroups: gmane.emacs.devel Subject: Re: Calc: `*' binds more strongly than `/' Date: Wed, 18 Apr 2007 23:55:14 +0200 Message-ID: <873b2xz6t9.fsf@totally-fudged-out-message-id> References: <87y7kvxj6p.fsf@arcor.de> <87odlrkn74.fsf@truman.edu> <87tzvhcul9.fsf@stupidchicken.com> <863b2z2mma.fsf@blue.stonehenge.com> <87abx6u905.fsf@truman.edu> Reply-To: cs-usenet@arcor.de NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1176933655 27799 80.91.229.12 (18 Apr 2007 22:00:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Apr 2007 22:00:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 19 00:00:49 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 1HeICj-00085X-4T for ged-emacs-devel@m.gmane.org; Thu, 19 Apr 2007 00:00:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeIHb-0000k9-2I for ged-emacs-devel@m.gmane.org; Wed, 18 Apr 2007 18:05:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HeIH9-0000NE-QY for emacs-devel@gnu.org; Wed, 18 Apr 2007 18:05:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HeIH9-0000Mw-7S for emacs-devel@gnu.org; Wed, 18 Apr 2007 18:05:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeIH9-0000Ms-3t for emacs-devel@gnu.org; Wed, 18 Apr 2007 18:05:19 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HeICF-0001cM-Sm for emacs-devel@gnu.org; Wed, 18 Apr 2007 18:00:16 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1HeIC3-0000fo-2U for emacs-devel@gnu.org; Thu, 19 Apr 2007 00:00:03 +0200 Original-Received: from finn.gmane.org ([80.91.229.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Apr 2007 00:00:03 +0200 Original-Received: from cs-usenet by finn.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 Apr 2007 00:00:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 89 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: finn.gmane.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux) Cancel-Lock: sha1:B5QMCab8RjMcJ+vDhwhV5DHxUK0= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:69591 Archived-At: Hello Jay and others, thanks for discussing this. Jay Belanger writes: [...] > Really? If I saw A*B/C*D, the main thing I'd be thinking is "Gee, I > wish parentheses were put in." You write `saw' here, I'll come back to that later... [...] > I just tried out 2*3/4*5 on a TI-86 and HP48; they both gave me 7.5. So does my Casio fx-115, and so did my previous Casio bought around 1990. > I don't have a TI myself, so I used a student's. There were several > grad students around, most of whom will eventually teach high > school. When I asked them what "2*3/4*5" should mean, I had a hard > time getting an answer. They kept saying "You're missing > parentheses" or "what are you trying to write?" I think you found a very good example: it's about what one /writes/ and /sees/ on paper and, on the other hand, what one /types/ on a pocket calculator (or in a spreadsheet). Writing 2*3/4*5 might be unclear when written on paper, but that is exactly what I'd _type_ in the calculator when I write/see on paper 2 * 3 ----- * 5 4 and when I write on paper 2 * 3 ----- 4 * 5 I _know_ I have to enter it as 2*3/(4*5), because my Casio and your HP and the TIs (and OpenOffice.org's spreadsheet...) evaluate from left to right. M-x quick-calc is made for such small calculations, but »M-x quick-calc RET 2*3/4*5 RET« gives Result: 2 3 / 4 5 => 0.3 which, interestingly, skips the `*' and thus looks exactly like what Stefan called the `juxtaposition notation': ,---- | Your point is valid when you use the juxtaposition notation rather | than *: A B / C D is indeed (A*B)/(C*D). `---- So does quick-calc try to give a hint here to the user what it has done by omitting the `*'? I'm not sure I would understand that hint. > But I think writing A*B/C*D when you mean A*(B/C)*D is poor > notation. Writing on paper, yes, but typing it in a pocket calculator, it is okay. I'm not sure how I'd write it in a spreadsheet program, for legibility reasons. But if I'd encounter it in someone else's code I knew how to `parse' it, from left to right. And so do the spreadsheet programs. And that is the heavy argument in my opinion: spreadsheets treat * and / equal and evaluate from left to right. > I also think writing A*B/C*D when you mean (A*B)/(C*D) is poor > notation, but a couple of people have said that it's a convenient > shortcut that saves the trouble of typing in parentheses. But then I say that writing A/B*C and interpreting it like (A/B)*C saves me the trouble of typing in parentheses and moreover, Calc would behave like the OpenOffice.org spreadsheet, Gnumeric, Excel, MATLAB, ... simply the things most people nowadays are used too. I didn't know that Calc has been around for a long time. I'm just curious how both `sides' could get their favourite behaviour (after the release): you mentioned that this could be made configurable -- what should be the default behaviour then? Compatibility with the old behaviour, or `behave as spreadsheets do'? I guess for safety reasons it should be compatibility ... Regards, Christian Schlauer