This commit is contained in:
@@ -10,7 +10,8 @@
|
|||||||
[spec-dict.main :refer [dict]]
|
[spec-dict.main :refer [dict]]
|
||||||
[net.deertopia.doerg.config :as cfg]
|
[net.deertopia.doerg.config :as cfg]
|
||||||
[com.rpl.specter :as sp]
|
[com.rpl.specter :as sp]
|
||||||
[clojure.tools.logging.readable :as lr])
|
[clojure.tools.logging.readable :as lr]
|
||||||
|
[clojure.zip :as z])
|
||||||
(:import (java.util UUID))
|
(:import (java.util UUID))
|
||||||
(:refer-clojure :exclude [read-string]))
|
(:refer-clojure :exclude [read-string]))
|
||||||
|
|
||||||
@@ -216,6 +217,18 @@
|
|||||||
rest-coll
|
rest-coll
|
||||||
(concat (rest rest-coll) [nil]))))
|
(concat (rest rest-coll) [nil]))))
|
||||||
|
|
||||||
|
(defn- =>> [wa-loc wa-loc->b]
|
||||||
|
(if-some [loc₀ (z/down wa-loc)]
|
||||||
|
(loop [loc-read loc₀
|
||||||
|
loc-write loc₀]
|
||||||
|
(let [loc-write' (z/replace loc-write (wa-loc->b loc-read))
|
||||||
|
next-loc-read (z/next loc-read)
|
||||||
|
next-loc-write (z/next loc-write')]
|
||||||
|
(if (z/end? next-loc-read)
|
||||||
|
(z/up loc-write')
|
||||||
|
(recur next-loc-read next-loc-write))))
|
||||||
|
wa-loc))
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
(-> [1 2 3 4]
|
(-> [1 2 3 4]
|
||||||
(neighbourly-mapcat prn) )
|
(neighbourly-mapcat prn) )
|
||||||
@@ -235,6 +248,7 @@
|
|||||||
#_
|
#_
|
||||||
sp/INDEXED-VALS]
|
sp/INDEXED-VALS]
|
||||||
(fn [siblings x]
|
(fn [siblings x]
|
||||||
|
(swap! r #(conj % {:siblings siblings :x x}))
|
||||||
x)
|
x)
|
||||||
doc)]
|
doc)]
|
||||||
@r))
|
@r))
|
||||||
|
|||||||
Reference in New Issue
Block a user