Autoformat specter.cljc

This commit is contained in:
djds 2022-10-28 18:50:00 +00:00
parent 548c18225a
commit 40cb36af48
No known key found for this signature in database

View file

@ -35,8 +35,7 @@
(defn- static-path? [path] (defn- static-path? [path]
(if (sequential? path) (if (sequential? path)
(every? static-path? path) (every? static-path? path)
(-> path i/dynamic-param? not) (-> path i/dynamic-param? not)))
))
(defn wrap-dynamic-nav [f] (defn wrap-dynamic-nav [f]
(fn [& args] (fn [& args]
@ -48,8 +47,7 @@
(first ret) (first ret)
:else :else
ret ret))))
))))
#?(:clj #?(:clj
(do (do
@ -74,7 +72,6 @@
(defmacro defcollector [name & body] (defmacro defcollector [name & body]
`(def ~name (collector ~@body))) `(def ~name (collector ~@body)))
(defn- late-bound-operation [bindings builder-op impls] (defn- late-bound-operation [bindings builder-op impls]
(let [bindings (partition 2 bindings) (let [bindings (partition 2 bindings)
params (map first bindings) params (map first bindings)
@ -190,7 +187,6 @@
(let [[name args] (name-with-attributes name args)] (let [[name args] (name-with-attributes name args)]
`(def ~name (dynamicnav ~@args)))) `(def ~name (dynamicnav ~@args))))
(defn- ic-prepare-path [locals-set path] (defn- ic-prepare-path [locals-set path]
(cond (cond
(vector? path) (vector? path)
@ -207,7 +203,6 @@
~(if-not (instance? Class (resolve path)) `(var ~path)) ~(if-not (instance? Class (resolve path)) `(var ~path))
(quote ~path))) (quote ~path)))
(i/fn-invocation? path) (i/fn-invocation? path)
(let [[op & params] path] (let [[op & params] path]
;; need special case for 'fn since macroexpand does NOT ;; need special case for 'fn since macroexpand does NOT
@ -219,13 +214,11 @@
~(mapv #(ic-prepare-path locals-set %) params) ~(mapv #(ic-prepare-path locals-set %) params)
(quote ~path)))) (quote ~path))))
:else :else
(if (empty? (i/used-locals locals-set path)) (if (empty? (i/used-locals locals-set path))
path path
`(com.rpl.specter.impl/->DynamicVal (quote ~path))))) `(com.rpl.specter.impl/->DynamicVal (quote ~path)))))
(defn- ic-possible-params [path] (defn- ic-possible-params [path]
(do (do
(mapcat (mapcat
@ -241,10 +234,8 @@
(sequential? e) (sequential? e)
(concat (if (vector? e) [e]) (ic-possible-params e)))) (concat (if (vector? e) [e]) (ic-possible-params e))))
path))) path)))
(defn- cljs-macroexpand [env form] (defn- cljs-macroexpand [env form]
(let [expand-fn (i/cljs-analyzer-macroexpand-1) (let [expand-fn (i/cljs-analyzer-macroexpand-1)
mform (expand-fn env form)] mform (expand-fn env form)]
@ -259,12 +250,10 @@
(let [expanded (if (seq? form) (cljs-macroexpand env form) form)] (let [expanded (if (seq? form) (cljs-macroexpand env form) form)]
(cljwalk/walk #(cljs-macroexpand-all* env %) identity expanded)))) (cljwalk/walk #(cljs-macroexpand-all* env %) identity expanded))))
(defn- cljs-macroexpand-all [env form] (defn- cljs-macroexpand-all [env form]
(let [ret (cljs-macroexpand-all* env form)] (let [ret (cljs-macroexpand-all* env form)]
ret)) ret))
(defmacro path (defmacro path
"Same as calling comp-paths, except it caches the composition of the static parts "Same as calling comp-paths, except it caches the composition of the static parts
of the path for later re-use (when possible). For almost all idiomatic uses of the path for later re-use (when possible). For almost all idiomatic uses
@ -343,7 +332,6 @@
~handle-params-code ~handle-params-code
~precompiled-sym)))) ~precompiled-sym))))
(defmacro select (defmacro select
"Navigates to and returns a sequence of all the elements specified by the path. "Navigates to and returns a sequence of all the elements specified by the path.
This macro will do inline caching of the path." This macro will do inline caching of the path."
@ -403,7 +391,6 @@
[apath structure] [apath structure]
`(i/compiled-multi-transform* (path ~apath) ~structure)) `(i/compiled-multi-transform* (path ~apath) ~structure))
(defmacro setval (defmacro setval
"Navigates to each value specified by the path and replaces it by `aval`. "Navigates to each value specified by the path and replaces it by `aval`.
This macro will do inline caching of the path." This macro will do inline caching of the path."
@ -440,14 +427,12 @@
[params & body] [params & body]
`(i/collected?* (~'fn [~params] ~@body))) `(i/collected?* (~'fn [~params] ~@body)))
(defn- protpath-sym [name] (defn- protpath-sym [name]
(-> name (str "-prot") symbol)) (-> name (str "-prot") symbol))
(defn- protpath-meth-sym [name] (defn- protpath-meth-sym [name]
(-> name (str "-retrieve") symbol)) (-> name (str "-retrieve") symbol))
(defmacro defprotocolpath (defmacro defprotocolpath
"Defines a navigator that chooses the path to take based on the type "Defines a navigator that chooses the path to take based on the type
of the value at the current point. May be specified with parameters to of the value at the current point. May be specified with parameters to
@ -505,11 +490,7 @@
~embed))) ~embed)))
(defmacro end-fn [& args] (defmacro end-fn [& args]
`(n/->SrangeEndFunction (fn ~@args))) `(n/->SrangeEndFunction (fn ~@args)))))
))
(defn comp-paths (defn comp-paths
"Returns a compiled version of the given path for use with "Returns a compiled version of the given path for use with
@ -547,7 +528,6 @@
(def ^{:doc "Version of select-first that takes in a path precompiled with comp-paths"} (def ^{:doc "Version of select-first that takes in a path precompiled with comp-paths"}
compiled-select-first i/compiled-select-first*) compiled-select-first i/compiled-select-first*)
(defn select-first* (defn select-first*
"Returns first element found." "Returns first element found."
[path structure] [path structure]
@ -601,7 +581,6 @@
(def ^{:doc "Version of vtransform that takes in a path precompiled with comp-paths"} (def ^{:doc "Version of vtransform that takes in a path precompiled with comp-paths"}
compiled-vtransform i/compiled-vtransform*) compiled-vtransform i/compiled-vtransform*)
(defn transform* (defn transform*
"Navigates to each value specified by the path and replaces it by the result of running "Navigates to each value specified by the path and replaces it by the result of running
the transform-fn on it" the transform-fn on it"
@ -611,7 +590,6 @@
(def ^{:doc "Version of `multi-transform` that takes in a path precompiled with `comp-paths`"} (def ^{:doc "Version of `multi-transform` that takes in a path precompiled with `comp-paths`"}
compiled-multi-transform i/compiled-multi-transform*) compiled-multi-transform i/compiled-multi-transform*)
(defn multi-transform* (defn multi-transform*
"Just like `transform` but expects transform functions to be specified "Just like `transform` but expects transform functions to be specified
inline in the path using `terminal` or `vterminal`. Error is thrown if navigation finishes inline in the path using `terminal` or `vterminal`. Error is thrown if navigation finishes
@ -620,7 +598,6 @@
[path structure] [path structure]
(compiled-multi-transform (i/comp-paths* path) structure)) (compiled-multi-transform (i/comp-paths* path) structure))
(def ^{:doc "Version of setval that takes in a path precompiled with comp-paths"} (def ^{:doc "Version of setval that takes in a path precompiled with comp-paths"}
compiled-setval i/compiled-setval*) compiled-setval i/compiled-setval*)
@ -647,7 +624,6 @@
(def dynamic-param? i/dynamic-param?) (def dynamic-param? i/dynamic-param?)
(def late-resolved-fn i/late-resolved-fn) (def late-resolved-fn i/late-resolved-fn)
(defdynamicnav (defdynamicnav
^{:doc "Turns a navigator that takes one argument into a navigator that takes ^{:doc "Turns a navigator that takes one argument into a navigator that takes
many arguments and uses the same navigator with each argument. There many arguments and uses the same navigator with each argument. There
@ -658,7 +634,6 @@
(dynamicnav [& args] (dynamicnav [& args]
(map latenavfn args)))) (map latenavfn args))))
;; Helpers for making recursive or mutually recursive navs ;; Helpers for making recursive or mutually recursive navs
(def local-declarepath i/local-declarepath) (def local-declarepath i/local-declarepath)
@ -675,8 +650,6 @@
(transform* [this structure next-fn] (transform* [this structure next-fn]
structure)) structure))
(def (def
^{:doc "Stays navigated at the current point. Essentially a no-op navigator."} ^{:doc "Stays navigated at the current point. Essentially a no-op navigator."}
STAY STAY
@ -732,8 +705,7 @@
(let [m (meta structure) (let [m (meta structure)
res (n/all-transform structure next-fn)] res (n/all-transform structure next-fn)]
(if (some? res) (if (some? res)
(with-meta res m) (with-meta res m)))))
))))
(defnav (defnav
^{:doc "Navigate to each value of the map. This is more efficient than ^{:doc "Navigate to each value of the map. This is more efficient than
@ -757,7 +729,6 @@
(transform* [this structure next-fn] (transform* [this structure next-fn]
(n/map-keys-transform structure next-fn))) (n/map-keys-transform structure next-fn)))
(defcollector VAL [] (defcollector VAL []
(collect-val [this structure] (collect-val [this structure]
structure)) structure))
@ -787,7 +758,6 @@
(let [s (start-index-fn structure)] (let [s (start-index-fn structure)]
(n/srange-transform structure s (n/invoke-end-fn end-index-fn structure s) next-fn)))) (n/srange-transform structure s (n/invoke-end-fn end-index-fn structure s) next-fn))))
(defnav (defnav
^{:doc "Navigates to the subsequence bound by the indexes start (inclusive) ^{:doc "Navigates to the subsequence bound by the indexes start (inclusive)
and end (exclusive)"} and end (exclusive)"}
@ -798,7 +768,6 @@
(transform* [this structure next-fn] (transform* [this structure next-fn]
(n/srange-transform structure start end next-fn))) (n/srange-transform structure start end next-fn)))
(defnav (defnav
^{:doc "Navigates to every continuous subsequence of elements matching `pred`"} ^{:doc "Navigates to every continuous subsequence of elements matching `pred`"}
continuous-subseqs continuous-subseqs
@ -809,7 +778,6 @@
(transform* [this structure next-fn] (transform* [this structure next-fn]
(i/continuous-subseqs-transform* pred structure next-fn))) (i/continuous-subseqs-transform* pred structure next-fn)))
(defnav (defnav
^{:doc "Navigate to the empty subsequence before the first element of the collection."} ^{:doc "Navigate to the empty subsequence before the first element of the collection."}
BEGINNING BEGINNING
@ -822,7 +790,6 @@
(let [to-prepend (next-fn [])] (let [to-prepend (next-fn [])]
(n/prepend-all structure to-prepend))))) (n/prepend-all structure to-prepend)))))
(defnav (defnav
^{:doc "Navigate to the empty subsequence after the last element of the collection."} ^{:doc "Navigate to the empty subsequence after the last element of the collection."}
END END
@ -849,8 +816,7 @@
structure structure
(if (nil? structure) (if (nil? structure)
#{newe} #{newe}
(conj structure newe) (conj structure newe))))))
)))))
(defnav (defnav
^{:doc "Navigate to 'void' element before the sequence. ^{:doc "Navigate to 'void' element before the sequence.
@ -864,8 +830,7 @@
(let [newe (next-fn NONE)] (let [newe (next-fn NONE)]
(if (identical? NONE newe) (if (identical? NONE newe)
structure structure
(n/prepend-one structure newe) (n/prepend-one structure newe)))))
))))
(defnav (defnav
^{:doc "Navigate to 'void' element after the sequence. ^{:doc "Navigate to 'void' element after the sequence.
@ -879,8 +844,7 @@
(let [newe (next-fn NONE)] (let [newe (next-fn NONE)]
(if (identical? NONE newe) (if (identical? NONE newe)
structure structure
(n/append-one structure newe) (n/append-one structure newe)))))
))))
(defnav (defnav
^{:doc "Navigates to the specified subset (by taking an intersection). ^{:doc "Navigates to the specified subset (by taking an intersection).
@ -897,7 +861,6 @@
(set/difference subset) (set/difference subset)
(set/union newset))))) (set/union newset)))))
(defnav (defnav
^{:doc "Navigates to the specified submap (using select-keys). ^{:doc "Navigates to the specified submap (using select-keys).
In a transform, that submap in the original map is changed to the new In a transform, that submap in the original map is changed to the new
@ -938,8 +901,7 @@
(if vs (if vs
(do (i/update-cell! values-to-insert next) (do (i/update-cell! values-to-insert next)
(first vs)) (first vs))
NONE NONE)))
)))
structure))))) structure)))))
(defrichnav (defrichnav
@ -951,18 +913,15 @@
(select* [this vals structure next-fn] (select* [this vals structure next-fn]
(if (contains? structure key) (if (contains? structure key)
(next-fn vals key) (next-fn vals key)
NONE NONE))
))
(transform* [this vals structure next-fn] (transform* [this vals structure next-fn]
(if (contains? structure key) (if (contains? structure key)
(let [newkey (next-fn vals key) (let [newkey (next-fn vals key)
dissoced (dissoc structure key)] dissoced (dissoc structure key)]
(if (identical? NONE newkey) (if (identical? NONE newkey)
dissoced dissoced
(assoc dissoced newkey (get structure key)) (assoc dissoced newkey (get structure key))))
)) structure)))
structure
)))
(defrichnav (defrichnav
^{:doc "Navigates to the given element in the set only if it exists in the set. ^{:doc "Navigates to the given element in the set only if it exists in the set.
@ -972,18 +931,15 @@
(select* [this vals structure next-fn] (select* [this vals structure next-fn]
(if (contains? structure elem) (if (contains? structure elem)
(next-fn vals elem) (next-fn vals elem)
NONE NONE))
))
(transform* [this vals structure next-fn] (transform* [this vals structure next-fn]
(if (contains? structure elem) (if (contains? structure elem)
(let [newelem (next-fn vals elem) (let [newelem (next-fn vals elem)
removed (disj structure elem)] removed (disj structure elem)]
(if (identical? NONE newelem) (if (identical? NONE newelem)
removed removed
(conj removed newelem) (conj removed newelem)))
)) structure)))
structure
)))
(def ^{:doc "Navigate to the specified keys one after another. If navigate to NONE, (def ^{:doc "Navigate to the specified keys one after another. If navigate to NONE,
that element is removed from the map or vector."} that element is removed from the map or vector."}
@ -1023,8 +979,7 @@
(select* [this vals structure next-fn] (select* [this vals structure next-fn]
(if (and (>= i 0) (< i (count structure))) (if (and (>= i 0) (< i (count structure)))
(next-fn vals i) (next-fn vals i)
NONE NONE))
))
(transform* [this vals structure next-fn] (transform* [this vals structure next-fn]
(if (and (>= i 0) (< i (count structure))) (if (and (>= i 0) (< i (count structure)))
(let [newi (next-fn vals i)] (let [newi (next-fn vals i)]
@ -1037,22 +992,17 @@
s structure] s structure]
(if (< j newi) (if (< j newi)
s s
(recur (dec j) (assoc s (inc j) (nth s j))) (recur (dec j) (assoc s (inc j) (nth s j)))))
))
(loop [j (inc i) (loop [j (inc i)
s structure] s structure]
(if (> j newi) (if (> j newi)
s s
(recur (inc j) (assoc s (dec j) (nth s j))) (recur (inc j) (assoc s (dec j) (nth s j))))))]
)))] (assoc shifted newi v))
(assoc shifted newi v)
)
(->> structure (->> structure
(setval (nthpath i) NONE) (setval (nthpath i) NONE)
(setval (before-index newi) v) (setval (before-index newi) v))))))
))))) structure)))
structure
)))
(defnav (defnav
^{:doc "Navigate to [index elem] pairs for each element in a sequence. The sequence will be indexed ^{:doc "Navigate to [index elem] pairs for each element in a sequence. The sequence will be indexed
@ -1065,8 +1015,7 @@
(let [i (i/mutable-cell (dec start))] (let [i (i/mutable-cell (dec start))]
(doseqres NONE [e structure] (doseqres NONE [e structure]
(i/update-cell! i inc) (i/update-cell! i inc)
(next-fn [(i/get-cell i) e]) (next-fn [(i/get-cell i) e]))))
)))
(transform* [this structure next-fn] (transform* [this structure next-fn]
(let [indices (i/mutable-cell (-> structure count range))] (let [indices (i/mutable-cell (-> structure count range))]
(reduce (reduce
@ -1080,15 +1029,12 @@
(let [ii2 (next ii)] (let [ii2 (next ii)]
(if (> newi curri) (if (> newi curri)
(transform [ALL #(>= % (inc curri)) #(<= % newi)] dec ii2) (transform [ALL #(>= % (inc curri)) #(<= % newi)] dec ii2)
ii2 ii2))))
))))
(->> s (->> s
(setval (nthpath curri) newe) (setval (nthpath curri) newe)
(setval (index-nav curri) newi) (setval (index-nav curri) newi))))
)))
structure structure
structure structure))))
))))
(def (def
^{:doc "`indexed-vals` with a starting index of 0."} ^{:doc "`indexed-vals` with a starting index of 0."}
@ -1104,7 +1050,6 @@
(transform* [this vals structure next-fn] (transform* [this vals structure next-fn]
(next-fn vals (afn structure)))) (next-fn vals (afn structure))))
(defnav (defnav
^{:doc "Navigate to the result of running `parse-fn` on the value. For ^{:doc "Navigate to the result of running `parse-fn` on the value. For
transforms, the transformed value then has `unparse-fn` run on transforms, the transformed value then has `unparse-fn` run on
@ -1116,7 +1061,6 @@
(transform* [this structure next-fn] (transform* [this structure next-fn]
(unparse-fn (next-fn (parse-fn structure))))) (unparse-fn (next-fn (parse-fn structure)))))
(defnav (defnav
^{:doc "Navigates to atom value."} ^{:doc "Navigates to atom value."}
ATOM ATOM
@ -1204,8 +1148,7 @@
(select* [this structure next-fn] (select* [this structure next-fn]
(next-fn (reduce late-fn (compiled-traverse late structure)))) (next-fn (reduce late-fn (compiled-traverse late structure))))
(transform* [this structure next-fn] (transform* [this structure next-fn]
(next-fn (reduce late-fn (compiled-traverse late structure))) (next-fn (reduce late-fn (compiled-traverse late structure))))))
)))
(def (def
^{:doc "Keeps the element only if it matches the supplied predicate. Functions in paths ^{:doc "Keeps the element only if it matches the supplied predicate. Functions in paths
@ -1214,7 +1157,6 @@
pred pred
i/pred*) i/pred*)
(defn ^:direct-nav pred= [v] (pred #(= % v))) (defn ^:direct-nav pred= [v] (pred #(= % v)))
(defn ^:direct-nav pred< [v] (pred #(< % v))) (defn ^:direct-nav pred< [v] (pred #(< % v)))
(defn ^:direct-nav pred> [v] (pred #(> % v))) (defn ^:direct-nav pred> [v] (pred #(> % v)))
@ -1308,8 +1250,7 @@
ns (namespace structure)] ns (namespace structure)]
(cond (keyword? structure) (keyword ns new-name) (cond (keyword? structure) (keyword ns new-name)
(symbol? structure) (symbol ns new-name) (symbol? structure) (symbol ns new-name)
:else (throw (ex-info "NAME can only be used on symbols or keywords" {:structure structure})) :else (throw (ex-info "NAME can only be used on symbols or keywords" {:structure structure}))))))
))))
(defnav ^{:doc "Navigates to the namespace portion of the keyword or symbol"} (defnav ^{:doc "Navigates to the namespace portion of the keyword or symbol"}
NAMESPACE NAMESPACE
@ -1322,8 +1263,7 @@
(cond (keyword? structure) (keyword new-ns name) (cond (keyword? structure) (keyword new-ns name)
(symbol? structure) (symbol new-ns name) (symbol? structure) (symbol new-ns name)
:else (throw (ex-info "NAMESPACE can only be used on symbols or keywords" :else (throw (ex-info "NAMESPACE can only be used on symbols or keywords"
{:structure structure})) {:structure structure}))))))
))))
(defdynamicnav (defdynamicnav
^{:doc "Adds the result of running select with the given path on the ^{:doc "Adds the result of running select with the given path on the
@ -1334,7 +1274,6 @@
(collect-val [this structure] (collect-val [this structure]
(compiled-select late structure)))) (compiled-select late structure))))
(defdynamicnav (defdynamicnav
^{:doc "Adds the result of running select-one with the given path on the ^{:doc "Adds the result of running select-one with the given path on the
current value to the collected vals."} current value to the collected vals."}
@ -1344,7 +1283,6 @@
(collect-val [this structure] (collect-val [this structure]
(compiled-select-one late structure)))) (compiled-select-one late structure))))
(defcollector (defcollector
^{:doc ^{:doc
"Adds an external value to the collected vals. Useful when additional arguments "Adds an external value to the collected vals. Useful when additional arguments
@ -1367,11 +1305,9 @@
[& path] [& path]
(late-bound-richnav [late (late-path path)] (late-bound-richnav [late (late-path path)]
(select* [this vals structure next-fn] (select* [this vals structure next-fn]
(i/exec-select* late [] structure (fn [_ structure] (next-fn vals structure))) (i/exec-select* late [] structure (fn [_ structure] (next-fn vals structure))))
)
(transform* [this vals structure next-fn] (transform* [this vals structure next-fn]
(i/exec-transform* late [] structure (fn [_ structure] (next-fn vals structure)))) (i/exec-transform* late [] structure (fn [_ structure] (next-fn vals structure))))))
))
(defrichnav (defrichnav
^{:doc "Drops all collected values for subsequent navigation."} ^{:doc "Drops all collected values for subsequent navigation."}
@ -1426,7 +1362,6 @@
late-then late-then
late-else)))))) late-else))))))
(defdynamicnav cond-path (defdynamicnav cond-path
"Takes in alternating cond-path path cond-path path... "Takes in alternating cond-path path cond-path path...
Tests the structure if selecting with cond-path returns anything. Tests the structure if selecting with cond-path returns anything.
@ -1441,7 +1376,6 @@
STOP STOP
pairs))) pairs)))
(defdynamicnav multi-path (defdynamicnav multi-path
"A path that branches on multiple paths. For updates, "A path that branches on multiple paths. For updates,
applies updates to the paths in order." applies updates to the paths in order."
@ -1457,15 +1391,13 @@
(let [res2 (i/exec-select* late2 vals structure next-fn)] (let [res2 (i/exec-select* late2 vals structure next-fn)]
(if (identical? NONE res1) (if (identical? NONE res1)
res2 res2
res1 res1)))))
)))))
(transform* [this vals structure next-fn] (transform* [this vals structure next-fn]
(let [s1 (i/exec-transform* late1 vals structure next-fn)] (let [s1 (i/exec-transform* late1 vals structure next-fn)]
(i/exec-transform* late2 vals s1 next-fn))))) (i/exec-transform* late2 vals s1 next-fn)))))
([path1 path2 & paths] ([path1 path2 & paths]
(reduce multi-path (multi-path path1 path2) paths))) (reduce multi-path (multi-path path1 path2) paths)))
(defdynamicnav stay-then-continue (defdynamicnav stay-then-continue
"Navigates to the current element and then navigates via the provided path. "Navigates to the current element and then navigates via the provided path.
This can be used to implement pre-order traversal." This can be used to implement pre-order traversal."
@ -1485,16 +1417,14 @@
walker walker
(recursive-path [afn] p (recursive-path [afn] p
(cond-path (pred afn) STAY (cond-path (pred afn) STAY
coll? [ALL p] coll? [ALL p])))
)))
(def (def
^{:doc "Like `walker` but maintains metadata of any forms traversed."} ^{:doc "Like `walker` but maintains metadata of any forms traversed."}
codewalker codewalker
(recursive-path [afn] p (recursive-path [afn] p
(cond-path (pred afn) STAY (cond-path (pred afn) STAY
coll? [ALL-WITH-META p] coll? [ALL-WITH-META p])))
)))
(let [empty->NONE (if-path empty? (terminal-val NONE)) (let [empty->NONE (if-path empty? (terminal-val NONE))
compact* (fn [nav] (multi-path nav empty->NONE))] compact* (fn [nav] (multi-path nav empty->NONE))]
@ -1502,5 +1432,4 @@
"During transforms, after each step of navigation in subpath check if the "During transforms, after each step of navigation in subpath check if the
value is empty. If so, remove that value by setting it to NONE." value is empty. If so, remove that value by setting it to NONE."
[& path] [& path]
(map compact* path) (map compact* path)))
))