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

Re: RFC: Multiple-alias syntax for for

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
June 10, 2021 08:48
Subject:
Re: RFC: Multiple-alias syntax for for
Message ID:
20210610094819.3e34a190@shy.leonerd.org.uk
On Thu, 10 Jun 2021 08:27:54 +0000
Nicholas Clark <nick@ccl4.org> wrote:

> 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.

I've often pondered stealing Python's "enumerate" function; so that
would be


  foreach my ($index, $item) (enumerate @array)
  {
    ...
  }

Where `enumerate LIST` just yields (0, LIST[0], 1, LIST[1], ...)

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

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