Yes, I find that much clearer too. Thanks! On Saturday, July 22, 2017 at 4:50:23 PM UTC-4, tbc++ wrote: > > If we think about what we're doing here is a stateful filter, then maybe > we could leverage a few more core Clojure functions: > > > (defn distinct-by [f coll] > (let [seen (atom #{})] > (filter (fn [itm] > (let [m (f itm)] > (when-not (@seen m) > (swap! seen conj m)))) > coll))) > >
-- 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 --- 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 clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.