Liking cljdoc? Tell your friends :D

dvlopt.rktree

README describes what ranked trees are.

This namespace provides recognizable functions for manipulating them.

README describes what ranked trees are.

This namespace provides recognizable functions for manipulating them.
raw docstring

assocclj/s

(assoc tree ranks v)
(assoc tree ranks path v)

Associates v at path which is then prioritized using ranks.

When path is not provided, associates directly after the ranks.

Cf. Namespace description for an example.

Associates `v` at `path` which is then prioritized using `ranks`.

When `path` is not provided, associates directly after the ranks.

Cf. Namespace description for an example.
sourceraw docstring

dissocclj/s

(dissoc tree ranks)
(dissoc tree ranks path)

Dissociates a value located at path and prioritized by ranks.

When path is not provided, dissociates everything for the given ranks.

Dissociates a value located at `path` and prioritized by `ranks`.

When `path` is not provided, dissociates everything for the given `ranks`.
sourceraw docstring

getclj/s

(get tree ranks)
(get tree ranks path)
(get tree ranks path not-found)

Find a value located at path that has been prioritized with ranks.

When path is not provided, returns everything at the given ranks.

Find a value located at `path` that has been prioritized with `ranks`.

When path is not provided, returns everything at the given `ranks`.
sourceraw docstring

popclj/s

(pop tree)

Respecting the ordering of ranks, returns a vector such as:

imeaning
0tree after popping
1ranks that led to node
2popped unsorted node at ranks

There might be no node to pop, and after popping a empty tree is returned as nil.

Respecting the ordering of ranks, returns a vector such as:

| i | meaning |
|---|---|
| 0 | tree after popping |
| 1 | ranks that led to node |
| 2 | popped unsorted node at ranks |

There might be no node to pop, and after popping a empty tree is returned as nil.
sourceraw docstring

pop-walkclj/s

(pop-walk tree f)
(pop-walk tree popped-tree->acc f)

Pops the given ranked tree and then walks the unsorted node in a depth-first manner by applying:

(f acc
   ranks
   path
   leaf)

After popping but before walking the unsorted node, the popped tree is transformed into acc by calling popped-tree->acc (defaulting to Clojure's identity).

See also pop.

Pops the given ranked `tree` and then walks the unsorted node in a depth-first manner by applying:

```clojure
(f acc
   ranks
   path
   leaf)
```

After popping but before walking the unsorted node, the popped tree is transformed into `acc`
by calling `popped-tree->acc` (defaulting to Clojure's `identity`).

See also [[pop]].
sourceraw docstring

r+clj/s

(r+ ranks-1 ranks-2)

Sums the given rank collections which might be of different length.

(r+ [0  5]
    [10 10 10])

[10 15 10]
Sums the given rank collections which might be of different length.

```clojure
(r+ [0  5]
    [10 10 10])

[10 15 10]
```
sourceraw docstring

treeclj/s

(tree)

Simply provides a sorted map, reminding that a ranked tree always start with at least one sorted map.

Should be used just in case the implementation changes and uses something else than Clojure's sorted maps.

Simply provides a sorted map, reminding that a ranked tree always start with at least one sorted map.

Should be used just in case the implementation changes and uses something else than Clojure's sorted maps.
sourceraw docstring

updateclj/s

(update tree ranks f)
(update tree ranks path f)

Update the value located at path and prioritized by ranks

When path is not provided, updates whatever there is at the given ranks.

If the result of applying f is nil, the value is removed.

Update the value located at `path` and prioritized by `ranks`

When `path` is not provided, updates whatever there is at the given `ranks`.

If the result of applying `f` is nil, the value is removed.
sourceraw docstring

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

× close