Hi,

On 3 Apr., 14:45, Roman Sykora <4rt.f...@gmail.com> wrote:

> Now, my question is what's the improvement of
>
> > (defn take-by [f coll]
> >   (let [fs (map f coll)
> >          ps (map = fs (rest fs))
> >          zs (map #(if %1 %2 sentinel) ps (rest coll))]
> >     (cons (first coll) (take-while (partial not= sentinel) zs))))
>
> over
>
> > (defn take-by
> >   [f coll]
> >   (lazy-seq
> >     (when-let [s (seq coll)]
> >       (let [fst   (first s)
> >             value (f fst)]
> >         (cons fst (take-while #(-> % f (= value)) (rest s)))))))

I summarised my issues with the different solutions. Since things got
a bit philosophical I wrote up a short blog post on my point of view:
http://bit.ly/hInw0J

Sincerely
Meikel

-- 
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

Reply via email to