Created
February 18, 2014 20:11
-
-
Save ericdwhite/9079003 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns user) | |
; The empty room | |
(def room {:id "room1" :people []}) | |
; People to add to the room | |
(def p1 {:id 1 :name "john"}) | |
(def p2 {:id 2 :name "sam"}) | |
; Adding people to the room | |
(defn join-rm [room person] | |
(let [people (:people room)] | |
(merge room {:people (merge people person)}))) | |
(def room' (join-rm room p1)) | |
(join-rm room' p2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment