On 2010 Apr 11, at 1:28 PM, Glen Rubin wrote:

I am working with a collection of sequences ...(e.g.
coll:
((/f /b /c /4 /5 /6 /3 /6 /f /4 /3 /2 /4 /5 /7 /3 /6) (/2 /b /c /4 / 2 /
6 /3 /7 /f /4 /3 /2 /4 /5 /7 /3 /6)...)


I want to partition the sequences into groups of 4, but when I try the
following or something similar it fails saying either partition or
apply is being passed the wrong number of args.

(map #(apply partition 4 %) coll)

partition takes a sequence as a single parameter.
I think what you might want is something like this:

user=> (def coll (list (range 10) (range 20 30) (range 40 50)))
#'user/coll
user=> (map #(partition 4 %) coll)
(((0 1 2 3) (4 5 6 7)) ((20 21 22 23) (24 25 26 27)) ((40 41 42 43) (44 45 46 47)))
user=>

-Doug

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to