Re: Grouping a list by 'sublists'..

2014-02-17 Thread Leif
Hi, Joerg. When I have a sequence I want to split into sub-sequences, I use the partition.* functions: (->> your-seq (partition-by string?) (partition 2)) will get you very close to your solution. A slightly lower-level technique if you need more control is to construct a lazy sequence yourself

Re: Grouping a list by 'sublists'..

2014-02-17 Thread Joerg
so, each string(type) is used as a grouping-key, which prefixes every each following string-in-a-vector as an argument to myfunc in the result list. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Grouping a list by 'sublists'..

2014-02-17 Thread Joerg
Hi, >From a for-function over some xml-input (filtered and mapped), I get this list: ("ITEM2" ["ITEM1"] ["B"] "A" "ITEM1" ["C"]) Now what I want is: ((myfunc ITEM2 ITEM1) (myfunc ITEM2 B) (myfunc ITEM1 C)) that is.. every string can have 0 or more vectors as follow-up items The String "A" has