Document NONE.

This commit is contained in:
Michael Fogleman 2017-10-06 18:37:35 -04:00
parent 2c4ca07c1f
commit b9f6411d84

View file

@ -25,6 +25,7 @@ It is a convention in Specter that unparameterized navigators are capitalized, w
- [NIL->LIST](#nil-list) - [NIL->LIST](#nil-list)
- [NIL->SET](#nil-set) - [NIL->SET](#nil-set)
- [NIL->VECTOR](#nil-vector) - [NIL->VECTOR](#nil-vector)
- [NONE](#none)
- [NONE-ELEM](#none-elem) - [NONE-ELEM](#none-elem)
- [STAY](#stay) - [STAY](#stay)
- [STOP](#stop) - [STOP](#stop)
@ -415,6 +416,22 @@ the structure has no metadata or may not contain metadata.
:foo :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
`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. `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.