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/Scheme/hash-join.ss
Normal file
20
Task/Hash-join/Scheme/hash-join.ss
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(use srfi-42)
|
||||
|
||||
(define ages '((27 Jonah) (18 Alan) (28 Glory) (18 Popeye) (28 Alan)))
|
||||
|
||||
(define nemeses '((Jonah Whales) (Jonah Spiders) (Alan Ghosts)
|
||||
(Alan Zombies) (Glory Buffy)
|
||||
(unknown nothing)))
|
||||
|
||||
(define hash (make-hash-table 'equal?))
|
||||
|
||||
(dolist (item ages)
|
||||
(hash-table-push! hash (last item) (car item)))
|
||||
|
||||
(do-ec
|
||||
(: person nemeses)
|
||||
(:let name (car person))
|
||||
(if (hash-table-exists? hash name))
|
||||
(: age (~ hash name))
|
||||
(print (list (list age name)
|
||||
person)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue