On Tue, May 31, 2011 at 3:45 PM, iz bash <killernemesisbl...@gmail.com> wrote: > > thanks everyone!! that was really great help.
You're welcome. Hopefully, reading and understanding the code posted here (not just mine) will both get you a better grasp of the various ways these kinds of things can be tackled using HOFs like map and reduce, but also help you spot occasions when you can use some of the less well known functions and techniques. (I had (partition 2 1 [] ...) as well as (map foo bar (rest bar)) to go over pairs of successive items from a seq; later I had mapcat for building a seq out of larger pieces; Malloy had keep to combine map and remove nil?; Bennett had partition-all and ->>; and Campbell had regexps. I'm not sure I've previously seen (defn foo [bar] (lazy-seq (if ... (into (foo (next bar) [some items]))))) used to construct a general lazy seq in chunks before. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en