develooper Front page | perl.perl5.porters | Postings from June 2021

Re: RFC: Multiple-alias syntax for for

Thread Previous | Thread Next
Nicholas Clark
June 10, 2021 08:28
Re: RFC: Multiple-alias syntax for for
Message ID:
On Thu, Jun 10, 2021 at 10:20:09AM +0200, Marco Fontani wrote:
> >     for my ($key, $value) (%hash) { ... }
> Could:
>     for my ($index, $value) (@array) { ... }
> ... be in the cards?

Not with *that* syntax, because that conflicts with general n-at-a-time.

But it's a problem that needs solving well, and I hope there will be an RFC
about it soon.

(The would-be author is currently asleep, so I can't confirm or deny
anything. I might be jumping the gun here, but there's a syntax suggestion
that builds on n-at-a-time to implement what you want. I hope I haven't
let too much slip, but I wanted to reply promptly.)

Nicholas Clark

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