Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
20
Task/Hash-join/TXR/hash-join.txr
Normal file
20
Task/Hash-join/TXR/hash-join.txr
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
@(do
|
||||
(defvar age-name '((27 Jonah)
|
||||
(18 Alan)
|
||||
(28 Glory)
|
||||
(18 Popeye)
|
||||
(28 Alan)))
|
||||
|
||||
(defvar nemesis-name '((Jonah Whales)
|
||||
(Jonah Spiders)
|
||||
(Alan Ghosts)
|
||||
(Alan Zombies)
|
||||
(Glory Buffy)))
|
||||
|
||||
(defun hash-join (left left-key right right-key)
|
||||
(let ((join-hash [group-by left-key left])) ;; hash phase
|
||||
(append-each ((r-entry right)) ;; join phase
|
||||
(collect-each ((l-entry [join-hash [right-key r-entry]]))
|
||||
^(,l-entry ,r-entry)))))
|
||||
|
||||
(format t "~s\n" [hash-join age-name second nemesis-name first]))
|
||||
Loading…
Add table
Add a link
Reference in a new issue