[Nickle] sort of a bug
Keith Packard
nickle@nickle.org
Fri, 14 Feb 2003 18:43:20 -0800
Around 16 o'clock on Feb 14, Bart Massey wrote:
> (BTW, is right-to-left
> associativity a part of the C standard, or just standard in
> implementations? I need to purchase or steal a copy of the
> C90 spec someday...)
Yes. Otherwise *a++ would "do the wrong thing".
> Second, s far as making the precedence of making postfix !
> different precedence from prefix !, it should just require a
> %prec declaration, no?
Nope. Yacc maps the %prec to the operator token; the same token always
yields the same precedence. I looked at the y.output file in some detail
to verify this.
> But this precedence change doesn't really fix the problem:
> in Nickle ~x++ will still be handled the same way as in C,
> which is arguably a bug because darnit, it should be
> left-to-right.
Why is left-to-right "correct"? It's just a matter of implicit
parenthesis.
-keith