isa?
(isa? child parent)
(isa? h child parent)
See Also:
Source docstring:
Returns true if (= child parent), or child is directly or indirectly derived from
parent, either via a JavaScript type inheritance relationship or a
relationship established via derive. h must be a hierarchy obtained
from make-hierarchy, if not supplied defaults to the global
hierarchy
(defn ^boolean isa?
([child parent] (isa? @(get-global-hierarchy) child parent))
([h child parent]
(or (= child parent)
(contains? ((:ancestors h) child) parent)
(and (vector? parent) (vector? child)
(== (count parent) (count child))
(loop [ret true i 0]
(if (or (not ret) (== i (count parent)))
ret
(recur (isa? h (child i) (parent i)) (inc i))))))))