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 11, 2021 09:38
Subject:
Re: RFC: Multiple-alias syntax for for
Message ID:
20210611103843.64d5f2e7@shy.leonerd.org.uk
On Thu, 10 Jun 2021 07:28:16 +0000
Nicholas Clark <nick@ccl4.org> wrote:

> What happens here if the list count isn't an integer multiple of 3?
> 
> To me, the most obvious answer was substitute undef if it's not
> (ie don't die, and don't ignore what would be incomplete 'tuples' at
> the end)

I'd agree with that. That's also consistent with how my newly-added
List::Util::zip and ::mesh functions work; documented thus:

>> ... If any input arrays run out of elements before others, then
>> "undef" will be inserted into the result to fill in the gaps.

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