Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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