Yes, it could be problematic if we extend the ambigious case in 9305871. Begin with:
x ? [y] - z
Ok, using the "precedence" rule, we reduce this to:
(x?[y]) - z
and go on:
x ? [y] - z : v
Oops, it was a ? : operator afterall. Too late now; have to report the ':' as a syntax error.
It'd be necessary to use a parenthesis:
x ? ([y] - z) : v
Essentially we get the rule: If the second expression in a ? : operator begins with a type cast, it has to be surrounded by parenthesis. Not that that will happen often, but it's a very ugly special case to document in the manual.
/ Martin Stjernholm, Roxen IS
Previous text:
2002-11-12 21:52: Subject: Re: More about ADTs
It feels like the beginning of foo?[bar]=zonk():zerblat().
/ Martin Nilsson (Fake Build Master)