develooper Front page | perl.perl6.users | Postings from August 2021

Re: pairs of separators from a string

Thread Previous | Thread Next
From:
Vadim Belman
Date:
August 22, 2021 03:09
Subject:
Re: pairs of separators from a string
Message ID:
23C0CD5B-E5EB-4FCB-A54E-777A54D466F9@lflat.org
I guess you need something like this:

my ($a, $b) = { @^a[0,2...Inf], @a[1,3...Inf] }.(q<(){}[]>.comb); say $a; say $b



Best regards,
Vadim Belman

> On Aug 21, 2021, at 3:04 AM, Marc Chantreux <eiro@phear.org> wrote:
> 
> hello,
> 
> i would like to get the list of opening (α) and closing
> (ω) separators from this string:
> 
>    &""''(){}[]
> 
> too many years of perl made me think about this solution
> or something alike but it didn't work.
> 
> my (\α,\ω) =| map
>    { .[0,2…∞], .[1,3…∞] },
>    q&""''(){}[]&.comb;
> 
> fixing this is important to me because it illustrate how bad i am to
> comprehend how raku flatten things.
> 
> regards,
> marc
> 
> 


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