Short start on destructuring.
This commit is contained in:
parent
b340cb6ccb
commit
cf4162ece6
@ -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
|
||||||
|
4
src/koans/destructuring.clj
Normal file
4
src/koans/destructuring.clj
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
(meditations
|
||||||
|
"Destructuring allows you to break up arguments"
|
||||||
|
(= __ ((fn [[a b]] (str b a))
|
||||||
|
[:foo :bar])))
|
@ -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]
|
||||||
|
@ -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)))
|
||||||
|
Loading…
Reference in New Issue
Block a user