jjmerelo
jjmerelo

Reputation: 23517

.pick not supported on a Mix?

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?

Upvotes: 7

Views: 122

Answers (1)

raiph
raiph

Reputation: 32404

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".

Upvotes: 4

Related Questions