develooper Front page | perl.perl5.porters | Postings from February 2022

Re: PSC #054 2022-02-11

Thread Previous | Thread Next
From:
Oodler 577 via perl5-porters
Date:
February 16, 2022 05:14
Subject:
Re: PSC #054 2022-02-11
Message ID:
YgyIKEZazA6EDRxX@odin.sdf-eu.org
* Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> [2022-02-15 18:09:23 +0000]:

> On Tue, 15 Feb 2022 17:57:27 +0000
> Oodler 577 via perl5-porters <perl5-porters@perl.org> wrote:
> 
> > This also got me thinking about "zip" operations, which are inverse
> > of what "kv" is; given 2 arrays, say @KEYS and @VALUES; "zip" would
> > produce the pairing that results in a hash.
> 
> You mean like:
> 
>   https://metacpan.org/pod/List::Util#zip
> 
> Also if you're feeling brave and want to try out my PL_infix_plugin
> branch:
> 
>   https://metacpan.org/pod/Syntax::Operator::Zip

Nice, I do like that the infix notation eliminates the need for the
lists to be passed as references.

I'll check it out. It may be prudent to use the word "interleaves"
in the description of what it does. Regardless, I'll check out both
implementations.

Also, to be pedantic; "zip" really just "interleaves" 2 lists. The
"zip"ing part happens naturally when the interleaved list is assigned
to a hash on the LHS of the "=". Effectively, though, I think it
makes more sense to call it "zip" as it's already presented.

Thanks for pointing out Syntax::Operator::Zip.

Cheers,
Brett
> 
> -- 
> Paul "LeoNerd" Evans
> 
> leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
> http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

-- 
--
oodler@cpan.org
oodler577@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdfeu.org
irc.perl.org #openmp #pdl #native

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