Liking cljdoc? Tell your friends :D

inspector.utils


flatten-treeclj

(flatten-tree adjacency-list node)

Returns a depth-first traversal of the tree. Where :start and :end represents the start or end of a node's exploration.

adjacency-list: map => { parent-node [child child ...], ... }. node: this node will be explored using depth first search.

(flatten-tree {1 [2 3] 2 [4] 3 [5]} 1)

=> [[1 :start 0] [2 :start 1] [4 :start 2] [4 :end 2] [2 :end 1] [3 :start 1] [5 :start 2] [5 :end 2] [3 :end 1] [1 :end 0]]

[node start/end depth] node: unique index of each node. start/end: [[node1 :start] ... [node1 :end]] everything in between are children of node1 level: level of node in the tree

Returns a depth-first traversal of the tree. Where :start and :end represents
the start or end of a node's exploration.

adjacency-list: map => { parent-node  [child child ...], ... }.
node: this node will be explored using depth first search.

(flatten-tree
    {1 [2 3]
     2 [4]
     3 [5]}
    1)

=> [[1 :start 0]
    [2 :start 1]
    [4 :start 2]
    [4 :end 2]
    [2 :end 1]
    [3 :start 1]
    [5 :start 2]
    [5 :end 2]
    [3 :end 1]
    [1 :end 0]]

[node start/end depth]
node: unique index of each node.
start/end:
  [[node1 :start] ... [node1 :end]]
  everything in between are children of node1
level: level of node in the tree
sourceraw docstring

full-nameclj

(full-name fn-meta)
source

prepare-fn-recordclj

(prepare-fn-record {:keys [c-tid tid c-id c-chain id uuid time e fn-rv fn-meta
                           fn-args]})
source

stringify-non-primitivesclj

(stringify-non-primitives data)
source

walk-n-replaceclj

(walk-n-replace f form)

Applies f to each non-collection thing. Non-collection thing is replaced by the return value.

Applies f to each non-collection thing.
Non-collection thing is replaced by the return value.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close