Re: Puzzling list comp error: "Don't know how to create ISeq from: clojure.lang.Keyword"

2014-08-30 Thread Sam Raker
`->` inserts its first argument into the second position of the next argument, and so on, so (-> [] (conj 1) (conj 2)) Turns into (conj (conj [] 1) 2) `->>` inserts its first argument into the LAST position of the next argument, and so on, so (->> 1 (conj [2]) (conj [3])) Turns into (co

Re: Puzzling list comp error: "Don't know how to create ISeq from: clojure.lang.Keyword"

2014-08-30 Thread gvim
On 30/08/2014 17:04, Alexey Kachayev wrote: Thread-first macro ->will insert list-of-listsas first argument for map, which is definitely not what you expect. Use threading-last ->>instead. I've never quite understood the distinction other than -> does everything top to bottom and ->> does the

Re: Puzzling list comp error: "Don't know how to create ISeq from: clojure.lang.Keyword"

2014-08-30 Thread Alexey Kachayev
Thread-first macro -> will insert list-of-lists as first argument for map, which is definitely not what you expect. Use threading-last ->> instead. 2014-08-30 18:48 GMT+03:00 gvim : > On 30/08/2014 15:07, Alexey Kachayev wrote: > >> for macro expects each pair to be either binding-form/collectio

Re: Puzzling list comp error: "Don't know how to create ISeq from: clojure.lang.Keyword"

2014-08-30 Thread gvim
On 30/08/2014 15:07, Alexey Kachayev wrote: for macro expects each pair to be either binding-form/collection-expr or one of known modifiers (:let, :when, :while). Here: plan (keyword (first l)) you give a pair of binding-form and keyword (which is really impossible to iterate over). If you me

Re: Puzzling list comp error: "Don't know how to create ISeq from: clojure.lang.Keyword"

2014-08-30 Thread gvim
On 30/08/2014 15:07, Alexey Kachayev wrote: for macro expects each pair to be either binding-form/collection-expr or one of known modifiers (:let, :when, :while). Here: plan (keyword (first l)) you give a pair of binding-form and keyword (which is really impossible to iterate over). If you me

Re: Puzzling list comp error: "Don't know how to create ISeq from: clojure.lang.Keyword"

2014-08-30 Thread Alexey Kachayev
for macro expects each pair to be either binding-form/collection-expr or one of known modifiers (:let, :when, :while). Here: plan (keyword (first l)) you give a pair of binding-form and keyword (which is really impossible to iterate over). If you meant let-binding for plan, dec, min and long, u

Puzzling list comp error: "Don't know how to create ISeq from: clojure.lang.Keyword"

2014-08-30 Thread gvim
I have a long function which produces `list-of-lists` : (("Sun" "21" "li" "13" "201.2139410") ("Moon" "11" "le" "21" "131.3457459") ..) before entering a list comprehension (simplified for brevity): (defn calc ... (let [ . ... list-of-lists (map #(res