Thank you for these solutions. You helped me a lot to get a tiny bit of clojure. This is indeed a different way to think about problems. At least it feels different to me.
On Mon, Jan 16, 2012 at 11:49 PM, Meikel Brandmeyer <[email protected]> wrote: > Hi, > > here another, slightly different, although in the core similar solution. > > (defn pair-seq > [lines] > (lazy-seq > (when-let [lines (seq lines)] > (let [line (first lines) > lines (next lines) > equal-sign (.indexOf line "=") > contd (take-while #(-> % (.indexOf "=") neg?) lines)] > (cons [(subs line 0 equal-sign) > (apply str (subs line (inc equal-sign)) contd)] > (pair-seq (seq (drop (count contd) lines)))))))) > > Whitespace handling is left as an exercise to the astute reader. ;-P > > Sincerely > Meikel > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
