Index: src/clj/clojure/core.clj
===================================================================
--- src/clj/clojure/core.clj	(revision 1222)
+++ src/clj/clojure/core.clj	(working copy)
@@ -2146,6 +2146,21 @@
   [s & vals]
     (. clojure.lang.PersistentStructMap (construct s vals)))
 
+(defn struct-basis
+  "Returns the structure-basis of a structmap instance."
+  [#^clojure.lang.PersistentStructMap s]
+  (. s getBasis))
+
+(defn struct-basis?
+  "Returns true if x is a structure-basis"
+  [x] (= (class x) clojure.lang.PersistentStructMap$Def))
+
+(defn struct?
+  "Returns true if x is a structmap. With a second argument s, return
+   true if x is a structmap with structure-basis s."
+  ([x] (= (class x) clojure.lang.PersistentStructMap))
+  ([x s] (and (struct? x) (= (struct-basis x) s))))
+
 (defn accessor
   "Returns a fn that, given an instance of a structmap with the basis,
   returns the value at the key.  The key must be in the basis. The
@@ -3193,17 +3208,20 @@
 (defn derive
   "Establishes a parent/child relationship between parent and
   tag. Parent must be a namespace-qualified symbol or keyword and
-  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."
+  child can be either a namespace-qualified symbol or keyword, a
+  class, or a structure-basis. h must be a hierarchy obtained from
+  make-hierarchy, if not supplied defaults to, and modifies,
+  the global hierarchy."
   ([tag parent]
    (assert (namespace parent))
-   (assert (or (class? tag) (and (instance? clojure.lang.Named tag) (namespace tag))))
+   (assert (or (class? tag) (struct-basis? 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) (instance? clojure.lang.Named tag)))
+   (assert (or (class? tag) (struct-basis? tag)
+	       (instance? clojure.lang.Named tag)))
    (assert (instance? clojure.lang.Named parent))
 
    (let [tp (:parents h)
Index: src/jvm/clojure/lang/PersistentStructMap.java
===================================================================
--- src/jvm/clojure/lang/PersistentStructMap.java	(revision 1222)
+++ src/jvm/clojure/lang/PersistentStructMap.java	(working copy)
@@ -174,6 +174,10 @@
 	return makeNew(_meta, def, vals, newExt);
 }
 
+public Def getBasis(){
+	return def;
+}
+
 public Iterator iterator(){
 	return new SeqIterator(seq());
 }
