Michael Lazzaro wrote:

> Damian Conway wrote:
> 
> > "you can leave a comma out either side of a block/closure, no matter
> > where it appears in the argument list"
> 
> Hmm.  I had been figuring the all conditional/loop stuff would be
> special cases within the grammar, because of their associated cruft...
> but if comma-optional is allowed on *either* side of any block, it
> means that their grammar becomes quite trivial.
> 
> That wins the less-special-cases war by a mile, so I emphatically
> withdraw my objection.

Ah.  It was only on reading that (and discovering that you hadn't
previously known about the 'optional comma with closure argument' rule)
that I understood why you had previously been so in favour of proposed
new syntaxes: through a desire to banish the Perl 5 syntax.

Mike, now you've come to terms with the Perl 5 syntax, do you still find
right-left pipelines as compelling as you've previously argued?

It seems that when chaining together functions, omitting C<< <~ >>
operators gives the same result in the familiar Perl 5 standard
function-call syntax:

  @foo = sort { ... } <~ map { ... } <~ grep { ... } <~ @bar;
  @foo = sort { ... } map { ... } grep { ... } @bar;

Left-right pipelines make sense to me.  I'm not yet sure how much I'd
use them, but there are times when I find it a little odd to have data
flowing 'upstream' in code, and reversing this could be nifty.

However right-left pipelines don't seem to add much to the language,
while becoming something else to have to learn and/or explain.
(Damian's explanation of what C<< <~ >> does to code seemed
significantly more involved than that of C<< ~> >>.)  And an alternative
spelling for the assignment operator[*0] doesn't strike me as something
Perl is really missing:

  $msg <~ 'Hello there';
  $msg = 'Hello there';

I realize that there's a symmetry between the two operators, but that
isn't a convincing reason for having them both.  People are used to data
flow in one direction; it seems reasonable only to have an operator when
wanting to change this, to make it go in the opposite direction.

What benefit does C<< <~ >> bring to the language?

Smylers

Reply via email to