Utility functions for supporting nested collections.
Utility functions for supporting nested collections.
(access-path reconstitution-path)
flat
returns a reconstitution path of both type and key. This is
useful for reprojecting the flat version up into a nested structure,
but is not amenable to get-in
, assoc-in
, et al. access-path
will
convert a reconstitution path into a more conventional access path.
`flat` returns a reconstitution path of both type and key. This is useful for reprojecting the flat version up into a nested structure, but is not amenable to `get-in`, `assoc-in`, et al. `access-path` will convert a reconstitution path into a more conventional access path.
(clean* m [k & ks])
Remove the key at k and any empty parents above it.
Remove the key at k and any empty parents above it.
(compare-paths [[a-type a-val :as first-a] & rest-a :as a]
[[b-type b-val :as first-b] & rest-b :as b])
(flat c)
Flattens a structure of associatives and sequentials to an associative of paths to leaf values. Each step in a path will retain both the type and the edge value, maps will be flattened to associatives. Vectors, lists, and other seqs will be flattened to sequentials.
Flattens a structure of associatives and sequentials to an associative of paths to leaf values. Each step in a path will retain both the type and the edge value, maps will be flattened to associatives. Vectors, lists, and other seqs will be flattened to sequentials.
(nested-update original provenance update author timestamp)
Does all of the book-keeping for nested map/vector combo data types.
original
is the original data structure, provenance
is the
original structure's provenance data, update
is a update function
to progress original.
Returns positionally: the updated original
, and, the updated provenance
.
Does all of the book-keeping for nested map/vector combo data types. `original` is the original data structure, `provenance` is the original structure's provenance data, `update` is a update function to progress original. Returns positionally: the updated `original`, and, the updated `provenance`.
(project vals)
(project vals basis)
Constitutes a structure as produced by flat
up into a nested
collection of maps and vectors. As all sequential items are coerced
to vectors, this is not reflexive of flat
.
Constitutes a structure as produced by `flat` up into a nested collection of maps and vectors. As all sequential items are coerced to vectors, this is not reflexive of `flat`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close