Merge pull request #20 from mwfogleman/none

Document NONE.
This commit is contained in:
Nathan Marz 2017-10-09 08:35:38 -07:00 committed by GitHub
commit 863e602b70

View file

@ -25,6 +25,7 @@ It is a convention in Specter that unparameterized navigators are capitalized, w
- [NIL->LIST](#nil-list)
- [NIL->SET](#nil-set)
- [NIL->VECTOR](#nil-vector)
- [NONE](#none)
- [NONE-ELEM](#none-elem)
- [STAY](#stay)
- [STOP](#stop)
@ -415,6 +416,22 @@ the structure has no metadata or may not contain metadata.
:foo
```
## NONE
`NONE` is a global value used to indicate no elements selected during `[[select-any]]`.
```clojure
=> (select-any (before-index 0) [1 2 3])
:com.rpl.specter.impl/NONE
```
`NONE` can also be used in transforms to remove elements:
```clojure
=> (setval ALL NONE [1 2 3])
[]
```
## NONE-ELEM
`NONE-ELEM` navigates to the 'void' elem in a set. For transformations - if the result is not `NONE`, then add that value to the set.