On 19.01.2010, at 17:58, Scott wrote:

one more question, what if one was to attempt the reverse, ie:

( 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 )

into

( 1 2 3 4 (5 6 7 8) ((9 10 11 12)) (((13 14 15 16))) )

There are certainly many ways to do it. Here is one:

(defn insert [[f & r]] (if (empty? r) f (concat f (list (insert r)))))
(insert (partition 4 '( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 )))

Konrad.

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