store/[org.clojure/clojure "1.8.0"] clj::clojure.core/descendants

Official Documentation

Add notes
Arities
==================================================
   [tag]
   [h tag]

Docstring
==================================================
  Returns the immediate and indirect children of tag, through a
  relationship established via derive. h must be a hierarchy obtained
  from make-hierarchy, if not supplied defaults to the global
  hierarchy. Note: does not work on Java type inheritance
  relationships.

Source

(defn descendants
  "Returns the immediate and indirect children of tag, through a
  relationship established via derive. h must be a hierarchy obtained
  from make-hierarchy, if not supplied defaults to the global
  hierarchy. Note: does not work on Java type inheritance
  relationships."
  {:added "1.0"}
  ([tag] (descendants global-hierarchy tag))
  ([h tag] (if (class? tag)
             (throw (java.lang.UnsupportedOperationException. "Can't get descendants of classes"))
             (not-empty (get (:descendants h) tag)))))

Example 1

Edit
;; simple example a toy poodle is a poodle is a dog is an animal

(derive ::dog ::animal)
;; => nil

(derive ::poodle ::dog)
;; => nil

(derive ::toy_poodle ::poodle)
;; => nil

(descendants ::animal)
;; => #{:user/toy_poodle :user/poodle :user/dog}

Uses on crossclj