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

Re: arithmetic operator precedence



Vincent Lefevre wrote:
> Also, when people don't agree about the precedence of operators, a
> solution could be to require parentheses (but I don't know if this
> is easy to implement such rules). At least ambiguity is avoided.

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.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



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