Merge pull request #1 from mwfogleman/recursive-path

Add documentation for recursive-path.
This commit is contained in:
Nathan Marz 2017-08-21 08:48:37 -04:00 committed by GitHub
commit e4b475080e

View file

@ -20,6 +20,7 @@
- [extend-protocolpath](#extend-protocolpath)
- [path](#path)
- [providepath](#providepath)
- [recursive-path](#recursive-path)
- [Collector Macros](#collector-macros)
- [defcollector](#defcollector)
- [Navigator Macros](#navigator-macros)
@ -355,6 +356,18 @@ Any higher order navigators passed to `path` must include their arguments, even
Defines the path that will be associated to the provided name. The name must have been previously declared using [declarepath](#declarepath).
## recursive-path
`(recursive-path params self-sym path)`
Assists in making recursive paths, both parameterized and unparameterized. Example:
```clojure
=> (let [tree-walker (recursive-path [] p (if-path vector? [ALL p] STAY))]
(select tree-walker [1 [2 [3 4] 5] [[6]]]))
[1 2 3 4 5 6]
```
# Collector Macros
## defcollector
@ -423,4 +436,4 @@ See also [nav](#nav)
`(nav params transform-impl select-impl)`
Returns an "anonymous navigator." See [defnav](#defnav).
Returns an "anonymous navigator." See [defnav](#defnav).