Re: Lazy group-by for sorted maps?

2013-08-13 Thread Colin Yates
Yep, sure. Thanks. On 13 Aug 2013 05:56, "Michael-Keith Bernard (SegFaultAX)" < mkbernard@gmail.com> wrote: > For the partition-by solution to work, you have to ensure that the result > set from the query is sorted by the foreign key: > > (partition-by identity "aaabbbcccaaabbbcc") > ;;=> ((\

Re: Lazy group-by for sorted maps?

2013-08-12 Thread Michael-Keith Bernard (SegFaultAX)
For the partition-by solution to work, you have to ensure that the result set from the query is sorted by the foreign key: (partition-by identity "aaabbbcccaaabbbcc") ;;=> ((\a \a \a) (\b \b \b) (\c \c \c) (\a \a \a) (\b \b \b) (\c \c)) (partition-by identity (sort "aaabbbcccaaabbbcc")) ;;=> ((\a

Re: Lazy group-by for sorted maps?

2013-08-12 Thread Colin Yates
Great - thanks! On 12 August 2013 19:07, Jonah Benton wrote: > > Sounds like a job for partition-by: > > http://clojuredocs.org/clojure_core/clojure.core/partition-by > > > > On Mon, Aug 12, 2013 at 1:55 PM, Colin Yates wrote: > >> Is there such a thing as a lazy group-by for a sequence of elem

Re: Lazy group-by for sorted maps?

2013-08-12 Thread Jonah Benton
Sounds like a job for partition-by: http://clojuredocs.org/clojure_core/clojure.core/partition-by On Mon, Aug 12, 2013 at 1:55 PM, Colin Yates wrote: > Is there such a thing as a lazy group-by for a sequence of elements when > the elements are sorted on the criteria used to group them? I can

Lazy group-by for sorted maps?

2013-08-12 Thread Colin Yates
Is there such a thing as a lazy group-by for a sequence of elements when the elements are sorted on the criteria used to group them? I can imagine how one would look in a few lines of Clojure code but I am surprised there isn't one already. My actual criteria is that I am pulling things from a