The right-left rule

John Kessenich jk at hpfelg.HP.COM
Thu Jul 19 06:31:28 AEST 1990


>Summary: in declarations as well as in expressions, postfix unary has higher
>precedence than prefix unary; parens may be used to override this.

K&R treats punctuation, i.e. 

    ()[].-> 

as operators having the highest precedence.  Thus, this all reduces to 

    "Declarations may be read correctly by starting with the name and
     then reading in precedence order."

This makes more sense (and seems simpler) to me than rules like 
"inside out", "alternating left and right", etc. which seem like artificial 
structures added on top of the language.

--------------
John Kessenich



More information about the Comp.lang.c mailing list