On Mon, Nov 9, 2009 at 2:31 PM, Emeka <emekami...@gmail.com> wrote:
>
> (defn group [x]
> (loop [newlist [] currlist x]
>  (if (not (empty? x))
>    (recur (newlist (cons (first x) newlist))
> (newlist (cons (first x) newlist))  You are making a function call here
> using an empty vector and your argument is a list. This is not possible,
> that's why you have that error ([] (cons 7 [])). When you make a vector a
> function its argument should the integer. Try and rework your code.

Thanks, I initially used conj but it wasn't working either.

>           (currlist (drop-while #(= (first currlist) %) currlist))
> This won't work too. drop-while returns a lazy sequence so you have
> (currlist (......))
>           ))))
>
> I would advice that you should spend some time with clojure, learning its
> data structures, function call and others in order to full appreciate how
> things play out .

Yup, that's what I'm doing. I wanted to see if I can implement a
recur solution as a clojure learning exercise.

-- 
Omnem crede diem tibi diluxisse supremum.

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