Reader: Source code (text) -> Clojure reader -> Data structures (code)
Compiler: [function or special form] -> bytecode, [macro] -> Data
structures (code)
Runtime: Data structures are evaluated:
Literals -> to themselves (1->1, "some string" -> "some
string", :some-key -> :some-key)
it is a bug in leiningen repl.
> lein repl
user=> (doall (repeatedly 3 read-line))
line1
line2
line3
line4
line5
("line1" "line3" "line5")
> java -cp clojure.jar clojure.main
user=> (doall (repeatedly 3 read-line))
line1
line2
line3
("line1" "line2" "line3")
--
(defn new-item-ks [wlists wlist-name]
(first
(keep-indexed #(when (= (:name %2) wlist-name)
[%1 :items (count (:items %2))])
wlists)))
(assoc-in wish-lists (new-item-ks wish-lists "WL2")
{:name "Item 3" :cost 10.0})
On Monday, September 24, 201