Hash join: Difference between revisions

m
→‎{{header|Raku}}: not obvious bare 'a' was code-ref, re-write for clarity
m (syntax highlighting fixup automation)
m (→‎{{header|Raku}}: not obvious bare 'a' was code-ref, re-write for clarity)
Line 2,700:
The <tt>.classify</tt> method returns a multimap represented as a <tt>Hash</tt> whose values are <tt>Array</tt>s.
 
{{works with|Rakudo|2016.07}}
<syntaxhighlight lang="raku" line>sub hash-join(@a, &a, @b, &b) {
my %hash := @b.classify(&b);
@a.map: -> $a {
|(%hash{a $a.&a} // next).map: -> $b { [$a, $b] }
}
}
 
# Testing:
 
my @A =
2,392

edits