Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: arithmetic operator precedence
- X-seq: zsh-workers 25212
- From: "Jun T." <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: arithmetic operator precedence
- Date: Thu, 19 Jun 2008 18:37:17 +0900
- In-reply-to: <200806171146.m5HBkhfR013230@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080612095723.GF5113@xxxxxxxxxxxxxxx> <20080616080726.GP10734@xxxxxxxxxxxxxxxxxxx> <20080616144211.276fb0e3@pws-pc> <2d460de70806170219k12ff4cadn441b52c48bf8076f@xxxxxxxxxxxxxx> <20080617094509.GC5016@xxxxxxxxxxxxxxx> <2d460de70806170324o5a44609x9383cc2445d67dd6@xxxxxxxxxxxxxx> <20080617103829.GD5016@xxxxxxxxxxxxxxx> <20080617114340.398c731f@news01> <20080617112815.GF10734@xxxxxxxxxxxxxxxxxxx> <200806171146.m5HBkhfR013230@xxxxxxxxxxxxxx>
At 0:46 PM +0100 08.6.17, Peter Stephenson wrote:
>As it looks like "some sort of"
>compatibility might as well be with other shells (so the option could
>really be called "SH_PRECEDENCES", although it's perhaps less obvious that
>means "something approximating to the precedences you probably expect if
>you are a regular programmer") this doesn't give us room for manoeuvre
>without yet another option.
-3**2 = 9 is quite counter-intuitive and "mathematically wrong",
but If the aim of the new option C_PRECECNECES (of SH_PRECEDENCES) is to
maximize the compatibility with other shells (not with perl etc.),
then I think we are forced to stick to -3**2 = 9.
Even if yet another new option is introduced which changes -3**2 to -9,
a user whould not notice it unless (s)he reads the long zsh man page
carefully.
I think it would be sufficient to add to the man page something like
"-3**2 gives 9, not -9, in zsh and many other shells.
Be sure to use parentheses -(3**2) if you want -9."
Of course I have no objection to adding yet another option.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author