Though you may need to do something like (flatten (nnext (partition-all 2 my-vec))) due to certain properties of partition-all:
user=> (partition-all 2 [1 2 3 4 5 6 7]) ((1 2) (3 4) (5 6) (7)) I'd be happy to hear a better option, since I actually just wrote code that did something like this the other day. On Wed, Aug 5, 2009 at 6:43 PM, Benjamin Stewart<bstew...@gmail.com> wrote: > See partition-all in seq-utils. > > user=> (partition-all 2 my-vec) > ((:a :b) (:c :d) (:e)) > > > On Wed, Aug 5, 2009 at 6:38 PM, Sean Devlin<francoisdev...@gmail.com> wrote: >> >> Hey all, >> I'm looking for a variation on partition. >> >> user=>(def my-vec [:a :b :c :d :e]) >> >> ;normal behavior >> user=>(partition 2 my-vec) >> ((:a :b) (:c :d)) >> >> The behavior I want is >> user=>(psuedo-partition 2 my-vec) >> ((:a :b) (:c :d) (:e)) >> >> Any suggestions? >> Sean >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---