From 007cbae060e9b767495ea078c368dca4461fa3e2 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Thu, 12 May 2016 10:43:41 -0500 Subject: [PATCH] Reverse order of quoting & macros koans The macros lesson depends on the quoting one. --- resources/koans.clj | 40 ++++++++++++---------- src/koans/{24_quote.clj => 18_quote.clj} | 2 +- src/koans/{18_macros.clj => 24_macros.clj} | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) rename src/koans/{24_quote.clj => 18_quote.clj} (97%) rename src/koans/{18_macros.clj => 24_macros.clj} (98%) diff --git a/resources/koans.clj b/resources/koans.clj index a1b467d..6505ffe 100644 --- a/resources/koans.clj +++ b/resources/koans.clj @@ -198,15 +198,13 @@ atomic-clock 20 :fin ]}] - ["18_macros" {"__" [~(first form) - ~(nth form 2) - form - (drop 2 form) - "Hello, Macros!" - 10 - '(+ 9 1) - '(* 10 2) - '(+ 10 (2 * 3))]}] + ["18_quote" {"__" ['(1 2 3 4 5) + (1 2 3 4 5) + 'age + quote + '(+ 2 3) + 1 2 3 + 1 5]}] ["19_datatypes" {"__" [(print (str "You're really the " @@ -226,8 +224,8 @@ 1024 ] "___" [#(.toUpperCase %) - ] - }] + ]}] + ["21_partition" {"__" [partition [:a :b :c] '((0 1 2) (3 4)) @@ -235,6 +233,7 @@ :hello (6 :these :are) ]}] + ["22_group_by" {"__" [odd? {5 ["hello" "world"] 3 ["foo" "bar"]} {1 [{:name "Bob" :id 1} @@ -244,6 +243,7 @@ {:naughty-list [{:name "Jimmy" :bad true} {:name "Joe" :bad true}] :nice-list [{:name "Jane" :bad false}]}]}] + ["23_meta" {"__" [{:league "National League"} {:division "West"} "This doesn't implement the IObj interface" @@ -254,11 +254,15 @@ :park "AT&T Park" 'Giants "Giants"]}] - ["24_quote" {"__" ['(1 2 3 4 5) - (1 2 3 4 5) - 'age - quote - '(+ 2 3) - 1 2 3 - 1 5]}] + + ["24_macros" {"__" [~(first form) + ~(nth form 2) + form + (drop 2 form) + "Hello, Macros!" + 10 + '(+ 9 1) + '(* 10 2) + '(+ 10 (2 * 3))]}] + ] diff --git a/src/koans/24_quote.clj b/src/koans/18_quote.clj similarity index 97% rename from src/koans/24_quote.clj rename to src/koans/18_quote.clj index f36298a..60621b9 100644 --- a/src/koans/24_quote.clj +++ b/src/koans/18_quote.clj @@ -1,4 +1,4 @@ -(ns koans.24-quote +(ns koans.18-quote (:require [koan-engine.core :refer :all])) diff --git a/src/koans/18_macros.clj b/src/koans/24_macros.clj similarity index 98% rename from src/koans/18_macros.clj rename to src/koans/24_macros.clj index 931dc75..d9017ea 100644 --- a/src/koans/18_macros.clj +++ b/src/koans/24_macros.clj @@ -1,4 +1,4 @@ -(ns koans.18-macros +(ns koans.24-macros (:require [koan-engine.core :refer :all])) (defmacro hello [x]