Public Vars

Back

descendants (clj)

(source)

function

(descendants tag) (descendants h tag)
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.

Examples

clojure/core.typed
(ns ^:skip-wiki clojure.core.typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  (:require [#?(:clj clojure.core.typed
                :cljs cljs.core.typed)
             :refer [defalias] :as t]))

(defalias
  ^{:doc "A hierarchy for use with derive, isa? etc."
    :forms '[Hierarchy]}
  t/Hierarchy
  '{:parents (t/Map Any Any)
    :ancestors (t/Map Any Any)
    :descendants (t/Map Any Any)})
typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  #?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
  (:require [clojure.core :as cc]
            [typed.clojure :as t]
            #?(:clj [typed.ann-macros.clojure :as macros])
            #?(:clj typed.ann.clojure.jvm) ;; jvm annotations
            #?(:clj clojure.core.typed))
  #?(:clj
     (:import (clojure.lang PersistentHashSet PersistentList
                            APersistentMap #_IPersistentCollection
                            #_ITransientSet
                            IRef)
              (java.util Comparator Collection))))

(t/defalias
  ^{:doc "A hierarchy for use with derive, isa? etc."
    :forms '[Hierarchy]}
  t/Hierarchy
  '{:parents (t/Map t/Any t/Any)
    :ancestors (t/Map t/Any t/Any)
    :descendants (t/Map t/Any t/Any)})