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
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 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)
Perfect!
On Aug 5, 1:51 pm, Mark Addleman wrote:
> Try partition-all in clojure.contrib.seq-utils
>
> On Aug 5, 10:38 am, Sean Devlin 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 m
Try partition-all in clojure.contrib.seq-utils
On Aug 5, 10:38 am, Sean Devlin 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-pa
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
--~--~-~--~~~-