Re: Forcing evaluation of args to a macro?

2013-02-15 Thread vxm
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)

Re: Repeatedly asking for user input i.e. calling (read-line) hangs?

2012-07-03 Thread vxm
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") --

Re: newbie question regarding maps

2012-09-26 Thread vxm
(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