Dave Whipp wrote:

And note that as pretty as -> is, we couldn't have <- for piping
because it would conflict rather strongly things like

   if ($a<-5)    # (negative five, or pipelike?)
Its resolved by the "longest token" rule, but it would be a common bug. So
it would be a potential problem.
Worse still, -> is not available at all, being already in use for
"pointy sub".



Otherwise, using -> and <- would be ideal.  Especially since then

    $foo->bar
  and
    $foo.bar

are exactly equiv, helping perl5 people.  Ah, well.  :-/

Not exactly equivalent: C<dot> would have a higher precedence than ->:
Not equivalent at all. C<$foo~>bar> means "append $foo to the argument list
of subroutine C<bar>". C<foo.bar> means "make C<$foo> the invocant for method <bar>".

Curiously enough, the confusions I'm hearing over this issue are, to me, the
strongest argument yet for using Andy's |> and <| symbols instead.

Damian

Reply via email to