Hash join: Difference between revisions
Content added Content deleted
(Restored visibility (to majority browser-type) of some labels in Input table of test case) |
(Added PicoLisp) |
||
Line 1,608: | Line 1,608: | ||
)</pre> |
)</pre> |
||
=={{header|PicoLisp}}== |
|||
<lang PicoLisp>(de A |
|||
(27 . Jonah) |
|||
(18 . Alan) |
|||
(28 . Glory) |
|||
(18 . Popeye) |
|||
(28 . Alan) ) |
|||
(de B |
|||
(Jonah . Whales) |
|||
(Jonah . Spiders) |
|||
(Alan . Ghosts) |
|||
(Alan . Zombies) |
|||
(Glory . Buffy) ) |
|||
(for X B |
|||
(let K (cons (char (hash (car X))) (car X)) |
|||
(if (idx 'M K T) |
|||
(push (caar @) (cdr X)) |
|||
(set (car K) (list (cdr X))) ) ) ) |
|||
(for X A |
|||
(let? Y (car (idx 'M (cons (char (hash (cdr X))) (cdr X)))) |
|||
(for Z (caar Y) |
|||
(println (car X) (cdr X) (cdr Y) Z) ) ) )</lang> |
|||
Output: |
|||
<pre>27 Jonah Jonah Spiders |
|||
27 Jonah Jonah Whales |
|||
18 Alan Alan Zombies |
|||
18 Alan Alan Ghosts |
|||
28 Glory Glory Buffy |
|||
28 Alan Alan Zombies |
|||
28 Alan Alan Ghosts</pre> |
|||
=={{header|Python}}== |
=={{header|Python}}== |