On Sat, Aug 7, 2010 at 6:55 PM, Michael Gardner <gardne...@gmail.com> wrote:
> On Aug 7, 2010, at 8:48 PM, Michael Gardner wrote:
>
>> On Aug 7, 2010, at 8:39 PM, gary ng wrote:
>>
>>> nice, why do I need the gensym ?
>>
>> The gensym was just a cheesy way of generating a unique value.
>
> To elaborate a bit more on my failure, I was reading the docs for 
> partition-by thinking that "new value" meant a value not before seen, not 
> simply a different value from the previous one. Then I accidentally hit 
> 'send' before I could test it and realize my mistake.
>
Using your partition-by help, this is what I come up

user=> (map (fn [l] (map second l)) (partition-by first (rest (reductions (fn [a
 e] [(if (even? e) (gensym) (first a)) e]) [(gensym)] [1 2 3 7 5 4 1]))))
((1) (2 3 7 5) (4 1))

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