Letter frequency: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (→{{header|Perl 6}}: Update, add example usage) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: style twiddles) |
||
Line 2,067: | Line 2,067: | ||
=={{header|Perl 6}}== |
=={{header|Perl 6}}== |
||
In perl6, whenever you want to count things in a collection, the rule of thumb is to use the Bag structure. |
In perl6, whenever you want to count things in a collection, the rule of thumb is to use the Bag structure. |
||
<lang perl6>.&ws.say for |
<lang perl6>.&ws.say for slurp.comb.Bag.sort: -*.value; |
||
sub ws ($pair) { |
sub ws ($pair) { |