Add advice about storing recursive paths.
This commit is contained in:
parent
fd8b0068cd
commit
b54b5e631e
1 changed files with 3 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ We can see that there are up to three elements to basic recursion:
|
||||||
|
|
||||||
# Using Specter Recursively
|
# Using Specter Recursively
|
||||||
|
|
||||||
The core way that Specter enables recursion is through the parameterized macro, `recursive-path`. `recursive-path` takes the following form:
|
The main way that Specter enables recursion is through the parameterized macro, `recursive-path`. `recursive-path` takes the following form:
|
||||||
|
|
||||||
`(recursive-path params self-sym path)`
|
`(recursive-path params self-sym path)`
|
||||||
|
|
||||||
|
|
@ -48,4 +48,6 @@ You can see that there are three arguments, which match onto our list above. (Th
|
||||||
|
|
||||||
(NOTE: QUESTION: Is there a reason why the self-sym is the second argument?)
|
(NOTE: QUESTION: Is there a reason why the self-sym is the second argument?)
|
||||||
|
|
||||||
|
Rather than providing a recursive function, `recursive-path` provides a recursive path that can be composed with other navigators. Accordingly, it is often useful - but not necessary - to define a recursive-path using `def`, so that it can be called in multiple places, not just the place where you initially need it.
|
||||||
|
|
||||||
# Applications
|
# Applications
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue