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

Re: idea: everything-slices

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
June 20, 2021 02:59
Subject:
Re: idea: everything-slices
Message ID:
CAHAeAG73-17YHhnAmrTkotPa=K=+VYNXbZ9HXw50n4iuuXbj5w@mail.gmail.com
On Sun, Jun 20, 2021 at 3:54 AM Ricardo Signes <perl.p5p@rjbs.manxome.org>
wrote:

> …
> This provides an easy way to get all the keys and values of an array,
> which pairs nicely with multi-target for:
>
> for my ($i, $v) (@array[*]) {
>   ...
> }
>
>
  Typo: s/@array/%array/

  … right?  (I'm not used to i/v array slice syntax yet, but if that's not
the intent, I'm missing something here.)


  On the bikeshedding, I was also thinking of @array[], though that makes
me think of Raku's Zen slices:
https://docs.raku.org/language/subscripts#Zen_slices

  So … are there any traps in confusing everything-slices with Zen slices?

  Alterntively, are there traps in confusing everything-slices with Raku's
Whatever-slicing (which gets the star)?


Eirik

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