Skip to content

Instantly share code, notes, and snippets.

@reiddraper
Created December 3, 2011 01:57
Show Gist options
  • Select an option

  • Save reiddraper/1425724 to your computer and use it in GitHub Desktop.

Select an option

Save reiddraper/1425724 to your computer and use it in GitHub Desktop.
(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