develooper Front page | perl.perl5.porters | Postings from November 2016

Re: [perl #130038] Builtin variable for loop index in foreach

Thread Previous | Thread Next
November 28, 2016 12:34
Re: [perl #130038] Builtin variable for loop index in foreach
Message ID:
Hugo van der Sanden via RT wrote:
>You also get the benefit that *you already have this*:

Except that foreach and while/each have completely different behaviour
with respect to iterators and modification during iteration.  There's
value in adding the indexed form of foreach, even with the language
already having array each.

>I'm guessing (wildly) that when the "experimental each on scalar"
>deprecation advances to removal, we could consider extending each()
>to lists to support:

Wouldn't be possible.  There's nowhere for the iterator to live.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About