Improve formatting.
This commit is contained in:
parent
6cb2dfceb4
commit
066f96d1f9
1 changed files with 20 additions and 23 deletions
|
|
@ -151,14 +151,13 @@ Binds the passed in seq of paths to `paths-binding`, which can be used in `selec
|
||||||
The implementation of `multi-path` is a nice example of the use of `variable-pathed-nav`.
|
The implementation of `multi-path` is a nice example of the use of `variable-pathed-nav`.
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
=> (defpathedfn multi-path
|
(defpathedfn multi-path [& paths]
|
||||||
[& paths]
|
|
||||||
(variable-pathed-nav [compiled-paths paths]
|
(variable-pathed-nav [compiled-paths paths]
|
||||||
(select* [this structure next-fn]
|
(select* [this structure next-fn]
|
||||||
(->> compiled-paths
|
(->> compiled-paths
|
||||||
;; seq with the results of navigating each passed in path
|
;; seq with the results of navigating each passed in path
|
||||||
(mapcat #(compiled-select % structure))
|
(mapcat #(compiled-select % structure))
|
||||||
;; pass each result to the following navigator
|
;; pass each result to the next navigator
|
||||||
(mapcat next-fn)
|
(mapcat next-fn)
|
||||||
doall))
|
doall))
|
||||||
(transform* [this structure next-fn]
|
(transform* [this structure next-fn]
|
||||||
|
|
@ -219,9 +218,7 @@ Binds the passed in path to `name`.
|
||||||
The implementation of `collect` is a good example of how `pathed-collector` can be used.
|
The implementation of `collect` is a good example of how `pathed-collector` can be used.
|
||||||
|
|
||||||
```clojure
|
```clojure
|
||||||
=> (defpathedfn
|
(defpathedfn collect [& path]
|
||||||
collect
|
|
||||||
[& path]
|
|
||||||
(pathed-collector [late path]
|
(pathed-collector [late path]
|
||||||
(collect-val [this structure]
|
(collect-val [this structure]
|
||||||
(compiled-select late structure))))
|
(compiled-select late structure))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue