|
|
Warp wrote:
> What you would have wanted is to make the unary minus to have a lower
> precedence. This would make "2^-3" illegal because a higher-precedence
> operator needs to be evaluated before the lower-precedence one and in
> this case it can't be done.
Ya know, this has been said before and I still don't see where it comes
from.
In the case of a^-b, there is no choice as to what order the operation
can be performed in, so precedence doesn't even come up. Precedence
isn't some rule that tells you what you can do, it just tells you which
operation to perform first when you have a choice.
If you look in the manual for Bison, for example, operator precedence is
a solution to an ambiguity. When there's no ambiguity, the parser
doesn't have to resort to checking precedence. I understand POV's
parser is probably different, but at least in an academic sense, the
relative precedence of ^ and unary minus have no effect on a^-b.
-josh
Post a reply to this message
|
|