On Sun, Apr 18, 2021 at 3:00 PM Joseph Brenner <[email protected]> wrote:
> Before I get started here, a small point about defining hashes.
> There are various ways that work:
>
> my %h1 = ( 'ha' => 1, 'ho' => 2, 'hum' => 3 );
> my %h2 = ( ha => 1, ho => 2, hum => 3 );
> my %h3 = ha => 1, ho => 2, hum => 3;
> my %h4 = 'ha' => 1, 'ho' => 2, 'hum' => 3;
>
>
Those are all lists of pairs, here's another way to write it
my %h5 = :ha<1>, :ho<2>, :hum<3>;
And even a list-of-things works as a hash initializer
my %h6 = 'ha', 1, 'ho', 2, 'hum', 3; # no pairs
say %h6<ho>; #2
as for the main point, interesting! I have the same question about
slurpy-named parameters now...