Damian Conway writes:

> Perhaps this is yet another argument for insisting on:
> 
>       while do {$n++; $foo > $bar}
> 
> instead.

Yes please!  Is anybody here a fan of the C comma?  I don't think I've
ever used it -- well, not intentionally, anyway -- but these are the
situations where I've spotted it being used:

  * iterating through multiple variables at once in a C-style C<for>
    loop (now C<loop>) -- this style of loop is rare itself in ideomatic
    Perl, and the Perl 6 C<for> syntax provides ways of looping with
    several variables

  * golf -- but I'm assuming that we aren't (purposefully) adding in
    features just for golfing reasons

  * constructs such as this [Perl 5]:

      warn "Invalid data", next unless /^\s*(\w+)\s*=\s*(.*)/ || /^\s*$/;

    Doing something else just before C<next> to abort a loop iteration
    is fairly common.  I dislike the above line because I find the order
    it evaluates in so awkward (end then start then middle), so always
    find some other way of expressing such logic.

    But it appears that many people do like using C<,> in this way, so
    removing it may be controversial.

> Because, like you, I sure would like to be able to get rid of those
> parens around comma'd lists.

I think the last time this came up[*0] Larry said that he was going to
make:

  my @num = 2, 97, 44;

'work' by fiddling with the precedence rules.  That sounds good, but I'd
still prefer the C comma to go away entirely.

  [*0]  Possibly in response to the proposal, synthesized into an RFC by
  Luke, that square brackets rather than parens be used to denote lists.

Smylers

Reply via email to