Skip to content

Instantly share code, notes, and snippets.

@gerritjvv
Created December 9, 2014 12:19
Show Gist options
  • Save gerritjvv/2dc9322f5cd1d29a4505 to your computer and use it in GitHub Desktop.
Save gerritjvv/2dc9322f5cd1d29a4505 to your computer and use it in GitHub Desktop.
ApplyClojureRecords
(defrecord MyItem [a b c])
(apply ->MyItem ["1" "2" "3"])
;; #user.MyItem{:a "1", :b "2", :c "3"}
(map #(apply ->MyItem %) [ [1 2 3] [4 5 6] [7 8 9]])
;;(#user.MyItem{:a 1, :b 2, :c 3} #user.MyItem{:a 4, :b 5, :c 6} #user.MyItem{:a 7, :b 8, :c 9})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment