clojure-koans/src/koans/destructuring.clj

12 lines
317 B
Clojure
Raw Normal View History

2010-11-06 22:38:31 +00:00
(meditations
"Destructuring is an arbiter: it breaks up arguments"
2010-11-06 22:38:31 +00:00
(= __ ((fn [[a b]] (str b a))
[:foo :bar]))
"Whether in function definitions"
(= "First comes love, then comes marriage, then comes Clojure with the baby carriage"
((fn [[a b c]] __)
["love" "marriage" "Clojure"]))
)