Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.pick not supported on a Mix?

Tags:

syntax

raku

I am trying this:

 my Mix $mix = { foo => 3.5, bar => 2.5}.Mix; 
 say $mix.pick

Which should theoretically work, since a Mix does Baggy, and Baggy does pick. However, I get the error:

.pick is not supported on a Mix

Any idea why it's not supported? What alternative should I use?

like image 836
jjmerelo Avatar asked Jul 22 '18 10:07

jjmerelo


1 Answers

Any idea why it's not supported?

Perhaps:

lizmat     TimToady: .pick($n > 1) on a MixHash, how would that work? I assume it won't work? What to deduct for a chosen key?
lizmat     (or on a Mix, for that matter)
TimToady   I don't we need to support .pick on a Mix until someone comes up with a real use case

From http://colabti.org/irclogger/irclogger_log/perl6?date=2013-10-03#l1369

What alternative should I use?

I suspect it's "write your own".

like image 55
raiph Avatar answered Nov 05 '22 17:11

raiph