summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2008-12-10 22:54:15 +0000
committerRich Hickey <richhickey@gmail.com>2008-12-10 22:54:15 +0000
commitd49f0d32473d8387696049b8b10b8403d86e05e4 (patch)
tree77ad5a9d1bd93e8dbdc26bf9843c5fd0d4b9b044
parent3bdb9f078fdb2154c458c89eddccb483e45c57f1 (diff)
releaxed namespace requirement for derives in private hierarchy, patch from J. McConnell
-rw-r--r--src/clj/clojure/core.clj9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index e84ec15c..e1e8d707 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -3041,12 +3041,15 @@
child can be either a namespace-qualified symbol or keyword or a
class. h must be a hierarchy obtained from make-hierarchy, if not
supplied defaults to, and modifies, the global hierarchy."
- ([tag parent] (alter-var-root #'global-hierarchy derive tag parent) nil)
+ ([tag parent]
+ (assert (namespace parent))
+ (assert (or (class? tag) (and (instance? clojure.lang.Named tag) (namespace tag))))
+
+ (alter-var-root #'global-hierarchy derive tag parent) nil)
([h tag parent]
(assert (not= tag parent))
- (assert (or (class? tag) (and (instance? clojure.lang.Named tag) (namespace tag))))
+ (assert (or (class? tag) (instance? clojure.lang.Named tag)))
(assert (instance? clojure.lang.Named parent))
- (assert (namespace parent))
(let [tp (:parents h)
td (:descendants h)