(Thanks everyone for all the replies! I'll address each response individually).
Awesome, thanks Ken! This solution is really cool, and it is what I was attempting to go for but my inexperience with this sort of functional style prevented me from seeing it. Of the solutions presented though, I think I like this one least. I feel it's way too convoluted, inelegant, and confusing. That said, I am very grateful for your coming up with it because it restores my faith that this kind of thing is at least possible. - Greg On Nov 8, 2010, at 3:02 PM, Ken Wesson wrote: > (defn new-gen [a] > (loop [a a t (transient [])] > (if (empty? a) > (distinct #(= (:val %1) (:val %2)) (persistent! t)) > (let [f (first a)] > (recur (rest a) > (loop [c [(transform-left f) (transform-right f)] t t] > (if (empty? c) > t > (let [n (first c)] > (if-not (contains? #(= (:val n) %) (map :val (parents n))) > (recur (rest c) (conj! t n)) > (recur (rest c) t)))))))))) > > -- > 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 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