"Mr. Nobody" <[EMAIL PROTECTED]> wrote :
> I have to wonder how many people actually like this syntax, and how many
only
> say they do because it's Damian Conway who proposed it. And map/grep
aren't
> "specialized syntax", you could do the same thing with a sub with a
prototype
> of (&block, *@list).

I 50% like it: I think Damian was on the right track. It will be good to
have a way
for L2R pipes to work (whatever the syntax): but the Perl5 syntax for R2L
works
for me already (I'm neutral about adding extra syntax for it).

But the squiggly arrow doesn't seem right. I contrast it with the anonymous
sub composer ("->") which was chosen, I think, because it worked well in
the context of a C<for> loop. Consider the following:

  $\ = "|";  $, = ",";

  1,2,3 -> { print } # 1,2,3
  1,2,3 ~> print;    # 1,2,3

  1,2,3 ~> -> { print } # 1,2,3, but ugly

  for 1,2,3 -> { print } # 1|2|3
  for 1,2,3 ~> print;    # 1|2|3, but syntax error (*)
  for 1,2,3 print;       # 1|2|3, but syntax error

  all(1,2,3) ~> print     # "junction(1,2,3)"
  all(1,2,3) -> { print } # 1|2|3, but random order

It seems to me that the difference between the straight and squiggly arrows
is that one works with named subs; and the other with anonymous. If this
distinction is necessary, and ubiquitous, then perhaps we can live with it.
But then we shift our perception to think that -> is an L2R pipe into a
block: not an anonymous sub composer. Similarly, the C<for> function is
a strange thing sends its elements down the pipe, one-by-one -- its not
a loop at afterall! (A junction, in contrast, would send its elements down
the pipe in random order, or concurrently).


Dave.

p.s. has Larry finished with those LoTR DVDs yet?


Reply via email to