diff --git a/ideaboard.txt b/ideaboard.txt index 29488dc..2305531 100644 --- a/ideaboard.txt +++ b/ideaboard.txt @@ -4,7 +4,6 @@ immutability/side effects state identity lifetime memoization lazy sequences -recursion recursive list processing trampolining reflection diff --git a/src/koans/destructuring.clj b/src/koans/destructuring.clj new file mode 100644 index 0000000..72a4958 --- /dev/null +++ b/src/koans/destructuring.clj @@ -0,0 +1,4 @@ +(meditations + "Destructuring allows you to break up arguments" + (= __ ((fn [[a b]] (str b a)) + [:foo :bar]))) diff --git a/src/path_to_answer_sheet.clj b/src/path_to_answer_sheet.clj index f410ecd..ba2f1ff 100644 --- a/src/path_to_answer_sheet.clj +++ b/src/path_to_answer_sheet.clj @@ -94,6 +94,7 @@ (if (zero? n) acc (recur (dec n) (* acc n))))]} + "destructuring" {"__" ["\":bar:foo\""]} }) (defn replace-with [s k replacements] diff --git a/src/path_to_enlightenment.clj b/src/path_to_enlightenment.clj index 4d24dfe..36df1a3 100644 --- a/src/path_to_enlightenment.clj +++ b/src/path_to_enlightenment.clj @@ -26,7 +26,8 @@ "runtime_polymorphism" "sequence_comprehensions" "partial_functions" - "recursion"]) + "recursion" + "destructuring"]) (defn run [] (apply load (doall (map (partial str "koans/") ordered-koans)))