Dang. I forgot about reduce. Thanks a lot for the really quick answer!

On Nov 30, 3:45 pm, Martin DeMello <martindeme...@gmail.com> wrote:
> On Tue, Dec 1, 2009 at 4:09 AM, samppi <rbysam...@gmail.com> wrote:
> > The title says it all. Is there a nice, concise, Clojurey way to
> > convert a vector [a b c d] into [[[a b] c] d]? It's fine if the
> > vectors are sequences instead. I can't think of a way without a loop,
> > but I suspect there's a much shorter way.
>
> user=> (reduce vector [1 2 3 4])
> [[[1 2] 3] 4]
>
> martin

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