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) ;;= ((\a \a \a)

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 colin.ya...@gmail.com 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

Re: Lazy group-by for sorted maps?

2013-08-12 Thread Colin Yates
Great - thanks! On 12 August 2013 19:07, Jonah Benton jo...@jonah.com 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 colin.ya...@gmail.comwrote: Is there such a thing as a lazy

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