2 comments

[ 4.1 ms ] story [ 15.9 ms ] thread
How about an explanation of what is going on here?
It's a combination of the | prefix operator that interpolates into a list, the ~ prefix stringification operator and the => infix pair constructor via << hyper operators so it works with a single value on the left and an array on the right.

So if $bin contained a list like [42, "foo", 7], we would get out a list of pairs

    1 => "42", 1 => "foo", 1 => "7"
Another way to write it would have been something along the lines of

    ($bin // Empty).map({ 1 => .Str }).slip
I did _not_ set out to write the code as obscurely as possible - it just happened 'naturally' ;)