Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (def vampire-database
- {0 {:makes-blood-puns? false :has-pulse? true :name "McFishwich"}
- 1 {:makes-blood-puns? false :has-pulse? true :name "McWackson"}
- 2 {:makes-blood-puns? true :has-pulse? false :name "Damon Salvatore"}
- 3 {:makes-blood-puns? true :has-pulse? true :name "Mickey Mouse"}})
- (defn vampire-related-details
- [social-security-number]
- (Thread/sleep 1000)
- (get vampire-database social-security-number))
- (defn vampire?
- [record]
- (and (:makes-blood-puns? record)
- (not (:has-pulse record))
- (record)))
- (defn identify-vampire
- [social-security-numbers]
- (first (filter vampire?
- (map vampire-related-details social-security-numbers))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement