Created
December 9, 2014 12:19
-
-
Save gerritjvv/2dc9322f5cd1d29a4505 to your computer and use it in GitHub Desktop.
ApplyClojureRecords
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
(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