On Mon, Nov 24, 2003 at 05:00:38PM -0700, Luke Palmer wrote:
> The C comma has always bugged me, but its function is indeed useful
> (many times I use C<and> in its place, if I know the left side will
> always be true). I don't know whether it's staying or not (I've heard
> rumors of both), but I'd suggest that it leave and allow itself to be
> replaced by a word, alongside C<and>, C<or>, and C<err>.

It certainly would solve the annoying Perl 5 "is it a list constructor or
the comma operator?"  No more user confusion and simpler parsing.  Maybe
even eliminate some more parens!  @foo = 1,2,3;

That reason alone is enough for me.


> This word:  C<then>.  
> 
> So, from a recent script of mine:
> 
>     my $n;
>     while $n++ then @accum < $total {
>         ...
>     }
> 
> (Where I got in trouble for using C<and> and never executing anything :-)
> 
> To me, it's very clear what's going on, and eliminates the mystery of
> the comma in scalar context for a syntax error.

I definately agree that this is used rarely enough that it should be a word
and not a single character.

"then" sounds too much like "if/then" which is confusing.  Its exactly
the opposite from what you're trying to convey.

It also doesn't convey anything about "evaluate the left hand side, ignore 
the results and evaluate the right".  Unfortunately, I don't have a better 
name.


-- 
Michael G Schwern        [EMAIL PROTECTED]  http://www.pobox.com/~schwern/
Now we come to that part of the email you've all been waiting for--the end.

Reply via email to