Reverse order of quoting & macros koans
The macros lesson depends on the quoting one.
This commit is contained in:
parent
6c00a3e358
commit
007cbae060
@ -198,15 +198,13 @@
|
|||||||
atomic-clock 20 :fin
|
atomic-clock 20 :fin
|
||||||
]}]
|
]}]
|
||||||
|
|
||||||
["18_macros" {"__" [~(first form)
|
["18_quote" {"__" ['(1 2 3 4 5)
|
||||||
~(nth form 2)
|
(1 2 3 4 5)
|
||||||
form
|
'age
|
||||||
(drop 2 form)
|
quote
|
||||||
"Hello, Macros!"
|
'(+ 2 3)
|
||||||
10
|
1 2 3
|
||||||
'(+ 9 1)
|
1 5]}]
|
||||||
'(* 10 2)
|
|
||||||
'(+ 10 (2 * 3))]}]
|
|
||||||
|
|
||||||
["19_datatypes" {"__" [(print
|
["19_datatypes" {"__" [(print
|
||||||
(str "You're really the "
|
(str "You're really the "
|
||||||
@ -226,8 +224,8 @@
|
|||||||
1024
|
1024
|
||||||
]
|
]
|
||||||
"___" [#(.toUpperCase %)
|
"___" [#(.toUpperCase %)
|
||||||
]
|
]}]
|
||||||
}]
|
|
||||||
["21_partition" {"__" [partition
|
["21_partition" {"__" [partition
|
||||||
[:a :b :c]
|
[:a :b :c]
|
||||||
'((0 1 2) (3 4))
|
'((0 1 2) (3 4))
|
||||||
@ -235,6 +233,7 @@
|
|||||||
:hello
|
:hello
|
||||||
(6 :these :are)
|
(6 :these :are)
|
||||||
]}]
|
]}]
|
||||||
|
|
||||||
["22_group_by" {"__" [odd?
|
["22_group_by" {"__" [odd?
|
||||||
{5 ["hello" "world"] 3 ["foo" "bar"]}
|
{5 ["hello" "world"] 3 ["foo" "bar"]}
|
||||||
{1 [{:name "Bob" :id 1}
|
{1 [{:name "Bob" :id 1}
|
||||||
@ -244,6 +243,7 @@
|
|||||||
{:naughty-list [{:name "Jimmy" :bad true}
|
{:naughty-list [{:name "Jimmy" :bad true}
|
||||||
{:name "Joe" :bad true}]
|
{:name "Joe" :bad true}]
|
||||||
:nice-list [{:name "Jane" :bad false}]}]}]
|
:nice-list [{:name "Jane" :bad false}]}]}]
|
||||||
|
|
||||||
["23_meta" {"__" [{:league "National League"}
|
["23_meta" {"__" [{:league "National League"}
|
||||||
{:division "West"}
|
{:division "West"}
|
||||||
"This doesn't implement the IObj interface"
|
"This doesn't implement the IObj interface"
|
||||||
@ -254,11 +254,15 @@
|
|||||||
:park "AT&T Park"
|
:park "AT&T Park"
|
||||||
'Giants
|
'Giants
|
||||||
"Giants"]}]
|
"Giants"]}]
|
||||||
["24_quote" {"__" ['(1 2 3 4 5)
|
|
||||||
(1 2 3 4 5)
|
["24_macros" {"__" [~(first form)
|
||||||
'age
|
~(nth form 2)
|
||||||
quote
|
form
|
||||||
'(+ 2 3)
|
(drop 2 form)
|
||||||
1 2 3
|
"Hello, Macros!"
|
||||||
1 5]}]
|
10
|
||||||
|
'(+ 9 1)
|
||||||
|
'(* 10 2)
|
||||||
|
'(+ 10 (2 * 3))]}]
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
(ns koans.24-quote
|
(ns koans.18-quote
|
||||||
(:require [koan-engine.core :refer :all]))
|
(:require [koan-engine.core :refer :all]))
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
(ns koans.18-macros
|
(ns koans.24-macros
|
||||||
(:require [koan-engine.core :refer :all]))
|
(:require [koan-engine.core :refer :all]))
|
||||||
|
|
||||||
(defmacro hello [x]
|
(defmacro hello [x]
|
Loading…
Reference in New Issue
Block a user