Re: RFC 120 (v2) Implicit counter in for statements, possibly$#.
[email protected] (Tom Christiansen) Wed, 30 Aug 2000 15:23:36 -0600
| Newsgroups | perl.perl6.language.flow |
|---|---|
| Message-ID | <9152.967670616@chthon> |
>I don't think anyone *needs* this, it would just be a nice syntactic >sugar. Haven't you ever coded a foreach loop only to realize later >that you need the index of the thing you've iterated to? Wouldn't it >be nice to just have access to it rather than hoop-jumping a little? On rare not common occasion. And then I've either added an $i++ in the foreach loop or else used a for(;;) loop. I am nervous about adding more special little invisible side-effect magic when it's something that is seldom needed and already feasible. And it won't be free, either, but that's not the biggest concern. --tom