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

Re: RFC: Multiple-alias syntax for for

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
June 10, 2021 08:28
Subject:
Re: RFC: Multiple-alias syntax for for
Message ID:
20210610082754.GY16703@etla.org
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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About