Add advice about storing recursive paths.

This commit is contained in:
Michael Fogleman 2017-09-21 13:40:27 -04:00
parent fd8b0068cd
commit b54b5e631e

View file

@ -40,7 +40,7 @@ We can see that there are up to three elements to basic recursion:
# 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)`
@ -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?)
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