Re: RFC 120 (v2) Implicit counter in for statements, possibly $#.

2000-08-17 Thread Christopher J. Madsen
I don't see why this should be an implicit counter. This (might) cause extra work for every foreach loop in every program (depending on how foreach is implemented). Why not use an explicit counter instead? Something like foreach $item $index (@array) { print $item, " is at index ",

Re: RFC 120 (v2) Implicit counter in for statements, possibly $#.

2000-08-18 Thread Christopher J. Madsen
David L. Nicol writes: Why not use an explicit perl5 counter? my $index; foreach $item (@array){ $index++; print $item, " is at index ", $index, "\n"; } Well, one reason is that your example doesn't work (it starts the index at 1 instead of 0). You'd need to do

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Christopher J. Madsen
Tom Christiansen writes: One could argue that do{} should take return so it might have a value, but this will definitely annoy the C programmers. So what. So what is that it *already* annoys us, which is *why* we would like to last out of a do. Perhaps you should be able to last

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Christopher J. Madsen
Peter Scott writes: I dunno, maybe a last in a do block whose value is used by something should be a syntax error. We're talking about code like $x += do { $y = get_num; last if $y == 99; $y } while defined $y; right? *Shudder* Yes, but we're also talking about code like