On Thursday, April 4, 2013 8:25:32 AM UTC-4, Jonathan Fischer Friberg wrote:

> I think group-by can do what you want (and more);
>

Hi Jonathan,

Thanks for the reply. I had looked at group-by, and hastily dismissed it 
due to lack of imagination. This would work, though it isn't as "pretty".

(let [is-odd (group-by odd? (range 1 11))]
  (println (is-odd false)))


I thought about map destructuring but I don't think it works with boolean 
keys. I think this is good enough though:

(let [is-odd (group-by odd? (range 1 11))
      evens (is-odd false)
      odds (is-odd true)]
  (println evens))

Thanks again

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to