Re: The C Comma

2003-11-25 Thread John Macdonald
On Tue, Nov 25, 2003 at 04:48:08PM -0700, Luke Palmer wrote: > Austin Hastings writes: > > "C" style C loops then look like: > > > > for (($a = 0; $b = $num_elts); $a < @arry; ($a++; $b -= $offset)) {...} > > By which you mean > > loop ($a = 0; $b = $num_elts); $a < @arry; ($a++; $b -= $of

RE: The C Comma

2003-11-25 Thread Gordon Henriksen
Adam Turoff wrote: > Damian Conway wrote: > > > Perhaps this is yet another argument for insisting on: > > > > while do {$n++; $foo > $bar} > > > > instead. > > That looks like syntactic sugar for > > while (do) {$n++; $foo > $bar} do is not merely prototyped, but a builtin. With

Re: The C Comma

2003-11-25 Thread Luke Palmer
gt; while "do" {...} ## perl5 bareword > > while do() {...} > > > > Luke's "then" feels like the best fit on the one hand, and the worst fit > > on the other. Everything else feels worse, though. > > Hmm. Why not just explicitly al

RE: The C Comma

2003-11-25 Thread Austin Hastings
> -Original Message- > From: Adam Turoff [mailto:[EMAIL PROTECTED] > On Tue, Nov 25, 2003 at 01:03:19PM +1100, Damian Conway wrote: > > Schwern observed: > > Perhaps this is yet another argument for insisting on: > > > > while do {$n++; $foo > $bar} > > > > instead. > > That looks li

Re: The C Comma

2003-11-25 Thread Jonathan Scott Duff
On Tue, Nov 25, 2003 at 01:46:39PM -0700, John Williams wrote: > On Mon, 24 Nov 2003, Jonathan Scott Duff wrote: > > or maybe throw some latin in there > > > > while $n++ et @accum < $total { ... } > > while $n++ cum @accum < $total { ... } # maybe? > > I think "ac" is the latin c

RE: The C Comma

2003-11-25 Thread Gordon Henriksen
Jonathan Scott Duff wrote: > or maybe throw some latin in there > > while $n++ et @accum < $total { ... } > while $n++ cum @accum < $total { ... } # maybe? "Et," of course, is unsuitable as a direct synonym for "and." I'm afraid that adding the second would cause Perl sourc

RE: The C Comma

2003-11-25 Thread Gordon Henriksen
Damian Conway wrote: > Micheal G. Schwern wrote: > > > It also doesn't convey anything about "evaluate the left > > hand side, ignore the results and evaluate the right". > > I think that's exactly what it conveys: > > The suspect drank half a dozen double whiskys then drove > into

Re: The C Comma

2003-11-25 Thread Adam Turoff
On Tue, Nov 25, 2003 at 01:03:19PM +1100, Damian Conway wrote: > Schwern observed: > >This may be a consequence of the example used > > > > while $n++ then $foo > $bar > > > >which I immediately associated with. > > > > if $n++ then $foo > $bar > > Yeah, I can certainly see that. > > Perh

Re: The C Comma

2003-11-25 Thread Mark J. Reed
On 2003-11-25 at 13:46:39, John Williams wrote: > On Mon, 24 Nov 2003, Jonathan Scott Duff wrote: > > or maybe throw some latin in there > > > > while $n++ et @accum < $total { ... } > > while $n++ cum @accum < $total { ... } # maybe? > > I think "ac" is the latin conjunction you

Re: The C Comma

2003-11-25 Thread John Williams
On Mon, 24 Nov 2003, Jonathan Scott Duff wrote: > or maybe throw some latin in there > > while $n++ et @accum < $total { ... } > while $n++ cum @accum < $total { ... } # maybe? I think "ac" is the latin conjunction you want. ac : conj. and, and also, and besides

Re: The C Comma

2003-11-25 Thread Smylers
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 a

Re: The C Comma

2003-11-25 Thread Jonathan Scott Duff
++ also @accum < $total { ... } or maybe throw some latin in there while $n++ et @accum < $total { ... } while $n++ cum @accum < $total { ... } # maybe? but that's probably more obscure than the comma. Okay, so I don't have any good ideas either, but I like "also" if we're getting rid of the "C comma". -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]

Re: The C Comma

2003-11-24 Thread Damian Conway
Schwern observed: A lot of people read "if (foo) { bar }" as "if foo then bar" in their heads. I'm one of them. Its not a previous syntax thing, its a translation to English thing. Fair enough. It's not something I do myself, but I can see that many people might prefer to. This may be a conseq

Re: The C Comma

2003-11-24 Thread Michael G Schwern
On Tue, Nov 25, 2003 at 12:21:13PM +1100, Damian Conway wrote: > >"then" sounds too much like "if/then" which is confusing. > > Why? "if/then" has never been Perl syntax. A lot of people read "if (foo) { bar }" as "if foo then bar" in their heads. I'm one of them. Its not a previous syntax thing

Re: The C Comma

2003-11-24 Thread Gregor N. Purdy
t will handle continue differently inside the "do" part (right?), but it fits my mental model nicely (this idea came from looking at looping constructs from Eiffel as well as elsewhere and looking for the unifying stuff). Regards, -- Gregor On Mon, 2003-11-24 at 16:00, Luke Palmer wr

Re: The C Comma

2003-11-24 Thread Damian Conway
I'm very much in favour of heteronymifying scalar vs list comma too. Or else eliminating one of them. Schwern wrote: "then" sounds too much like "if/then" which is confusing. Why? "if/then" has never been Perl syntax. It also doesn't convey anything about "evaluate the left hand side, ignore th

Re: The C Comma

2003-11-24 Thread Rod Adams
o 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. C Of course I've always thought the semicolon would have been a better choice for the "C comma". That

Re: The C Comma

2003-11-24 Thread Jonathan Worthington
> Honestly you guys, I'm not trolling. I'm just getting a lot of ideas > recently. :-) Honestly, I'm not an expert on Perl 6 syntax. (And I actually am being honest... ;-) But I'll throw in my 2 cents anyway. :-) > > > This word: C. > > So, from a recent script of mine: > > my $n; >

Re: The C Comma

2003-11-24 Thread Michael G Schwern
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 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 &g

The C Comma

2003-11-24 Thread Luke Palmer
Honestly you guys, I'm not trolling. I'm just getting a lot of ideas recently. :-) The C comma has always bugged me, but its function is indeed useful (many times I use C in its place, if I know the left side will always be true). I don't know whether it's staying or not (