diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-03-18 01:22:47 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-03-18 01:22:47 +0000 |
commit | cb874e723057d22a3e711c179875edcda2ff3990 (patch) | |
tree | 9a79ba6b0553c50b588ebab6d5a0b85d76980a34 | |
parent | 05678fad1edc8a689aebdc21c71ee91c6210f32a (diff) |
ancestors did not include the tag parents of a class' superclasses [issue 94], patch from cemerick
-rw-r--r-- | src/clj/clojure/core.clj | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index 397ca177..f44fcb71 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -3343,7 +3343,10 @@ ([h tag] (not-empty (let [ta (get (:ancestors h) tag)] (if (class? tag) - (into (set (supers tag)) ta) + (let [superclasses (set (supers tag))] + (reduce into superclasses + (cons ta + (map #(get (:ancestors h) %) superclasses)))) ta))))) (defn descendants |