Created
December 3, 2011 01:57
-
-
Save reiddraper/1425724 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (defbox Account | |
| ;; the second item in the | |
| ;; list is a type or protocol | |
| ;; to restrict the value to | |
| (:name LWWRegister :required true) | |
| (:address LWWRegister :required true) | |
| ;; specify a default value for this field, | |
| ;; in this case, the result of calling the | |
| ;; function `lww-set` | |
| (:followers ObservedRemoveSet :default (lww-set))) | |
| (def person (Account.)) | |
| (-> person | |
| ;; add :bar to the followers list | |
| (update-in [:followers] conj :bar) | |
| ;; set the name | |
| (assoc-in [:name] "Reid") | |
| ;; set the address | |
| (assoc-in [:address] "27 Lexington Ave")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment