Short start on destructuring.

This commit is contained in:
Colin Jones 2010-11-06 17:38:31 -05:00
parent b340cb6ccb
commit cf4162ece6
4 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,6 @@ immutability/side effects
state identity lifetime state identity lifetime
memoization memoization
lazy sequences lazy sequences
recursion
recursive list processing recursive list processing
trampolining trampolining
reflection reflection

View File

@ -0,0 +1,4 @@
(meditations
"Destructuring allows you to break up arguments"
(= __ ((fn [[a b]] (str b a))
[:foo :bar])))

View File

@ -94,6 +94,7 @@
(if (zero? n) (if (zero? n)
acc acc
(recur (dec n) (* acc n))))]} (recur (dec n) (* acc n))))]}
"destructuring" {"__" ["\":bar:foo\""]}
}) })
(defn replace-with [s k replacements] (defn replace-with [s k replacements]

View File

@ -26,7 +26,8 @@
"runtime_polymorphism" "runtime_polymorphism"
"sequence_comprehensions" "sequence_comprehensions"
"partial_functions" "partial_functions"
"recursion"]) "recursion"
"destructuring"])
(defn run [] (defn run []
(apply load (doall (map (partial str "koans/") ordered-koans))) (apply load (doall (map (partial str "koans/") ordered-koans)))