Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: arithmetic operator precedence



On 2008-06-17 12:46:43 +0100, Peter Stephenson wrote:
> That would be quite sensible, but the problem is we already have two
> cases: traditional zsh behaviour, which we don't want to change now, and
> "some sort of" compatilibity mode.  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.

Yes, at least two options are needed. You have the precedences defined
by POSIX (e.g. & vs ==). But concerning the power operator **, this
isn't defined by POSIX, and even the other shells that implement it
may change its behavior and/or make the behavior controlled by an
option.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author