On Thu, Oct 19, 2006 at 03:31:18PM -0700, Jonathan Lang wrote:
: Larry Wall wrote:
: >Though actually, now that I think about it, the cascaded notation
: >in S12 is illegal according to S03, since "does" is classified as
: >non-chaining, which implies non-associative.
: 
: Wait a minute.  Isn't "chaining" specifically referring to the idea
: that "A op B op C" implicitly becomes something like "A op B && B op
: C"?  That would seem to be unrelated to the concept of associativity,
: other than the fact that you can't have chaining without
: associativity.  Why would "does" have to be chaining in order to be
: associative?

I was using "non-chaining" to indicate a particular precedence
level.  (In actual fact, all precedence levels but chaining are
non-chaining, but only one precedence level actually has that name.)
The non-chaining precedence level is a bunch non-associative operators
like .. and cmp.  Historically, all operators of a particular precedence
level have had the same associativity, so that when you analyze

    $a op1 $b op2 $c

you only have to compare op1 with op2 if they're the same precedence, and
given the prededence you don't actually have to look at the individual
ops.  What would it mean to have a left-associative op at the same precedence
level as a right-associative op:

    $a lefty $b righty $c

Who would win?  So generally we try not to mix associativity within a
precedence level.

For now the conservative thing is probably that we should just leave
"does" as non-associative and make you write

    $obj.also_does(A,B,C)

or some such if you want to get fancy.

Larry

Reply via email to