emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calc: `*' binds more strongly than `/'


From: Christian Schlauer
Subject: Re: Calc: `*' binds more strongly than `/'
Date: Sun, 22 Apr 2007 12:27:14 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux)

Daniel Brockman <address@hidden> writes:

> Christian Schlauer <address@hidden> writes:
>
>> But then I say that writing A/B*C and interpreting it like (A/B)*C
>> saves me the trouble of typing in parentheses
>
> Not really.  You could just type that as A*C/B.

Yes. But I don't have to think about such things /at all/ in /all
other programs/ I use, because they use the common syntax, and I don't
see the benefit of Emacs having its own rules.

> The point is that the reduced precedence of `/' allows you
> to always put all numerator factors before the slash and all
> denominator factors after it, which is often very convenient.

Your convenient behaviour does neither work in Excel, OpenOffice.org
spreadsheet, or MATLAB, nor on a TI, HP or Casio pocket calculator.
What do you win with that convenient behaviour compared to that it
confuses people that also use other, more common spreadsheets (or
MATLAB) besides Emacs? /They/ can get wrong results. You safe some
keystrokes.

> (You could make the same argument for `+' and `-' --- i.e.,
> that `A-B+C' should mean `A-(B+C)'.  However, this is not as
> natural because one usually does not think of sums as units.
> Writing `A-B-C' is completely natural, but `A/B/C' is not
> completely natural --- in fact, it is a little confusing.)

Here I don't follow you -- except for that you can write `A/B/C' in
Calc or any other software, and you will get the same result
*everywhere*, even in Calc. (But I wouldn't write it that way either.)

> I think this is good notation, but I also think that it
> would be a good idea to warn the user and make sure that
> they know what they are doing when entering such things.

I fully agree with Stefan:

,----
| In any case, I still haven't heard any concrete reason why the
| non-standard behavior of calc is preferred to the more common
| behavior. Neither is perfect because there is no such thing, but one
| of them is sufficiently surprising to deserve big warnings in the
| Calc doc and the Org doc, whereas the other would be "business as
| usual".
`----

Regards,

Christian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]