(create-path-in path value)
create a path starting at map through all keys in map: (create-path-in '(a b c d e) value) => {:a {:b {:c {:d {:e value}}}}})
create a path starting at map through all keys in map: (create-path-in '(a b c d e) value) => {:a {:b {:c {:d {:e value}}}}})
(deserialize serialized & [always-create-atom?])
Turns a serialized representation, as returned by (serialize), above, back into a DAG. serialized is a list of pairs that look like: <pathset,value>. The first element of the list has an empty pathset, and the value is the 'skeleton' of the entire tree. For the rest of the elements in the list, an atom is created for the common value, and each path in the pathset points to that atom, and this result is then merged with the skeleton. If always-create-atom? is true, (deserialize) will not create an atom for a value where there is only path pointing to it, as an optimization, since it saves time and space when copying or unifying.
Turns a serialized representation, as returned by (serialize), above, back into a DAG. _serialized_ is a list of pairs that look like: <pathset,value>. The first element of the list has an empty pathset, and the value is the 'skeleton' of the entire tree. For the rest of the elements in the list, an atom is created for the common value, and each path in the pathset points to that atom, and this result is then merged with the skeleton. If always-create-atom? is true, (deserialize) will not create an atom for a value where there is only path pointing to it, as an optimization, since it saves time and space when copying or unifying.
(find-paths-to-value input value path)
find all paths in map which are equal to value, where value is (ref?)=true.
find all paths in _map_ which are equal to _value_, where _value_ is (ref?)=true.
(merge-skeleton si)
For all shared values with only a single path leading to it, the corresponding value is merged with the base 'skeleton', and that path-value pair is removed from the serialized representation.
For all shared values with only a single path leading to it, the corresponding value is merged with the base 'skeleton', and that path-value pair is removed from the serialized representation.
(ref-skel-map input-map)
associate each reference in input-map with:
associate each reference in _input-map_ with: 1. its skeleton 2. all paths to point to it.
(serialize input-map)
Turns a DAG into a serialized representation, which can be again deserialized by (deserialize) (below). Returns a list of pairs that look like: <pathset,value>. The first element of the list has an empty pathset, and the value is the 'skeleton' of the entire tree. For the rest of the elements in the list, each element contains a list of paths, and a common value, which all paths share.
Turns a DAG into a serialized representation, which can be again deserialized by (deserialize) (below). Returns a list of pairs that look like: <pathset,value>. The first element of the list has an empty pathset, and the value is the 'skeleton' of the entire tree. For the rest of the elements in the list, each element contains a list of paths, and a common value, which all paths share.
(skels input-map refs)
create map from reference to their skeletons.
create map from reference to their skeletons.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close