Document index-nav.

This commit is contained in:
Michael Fogleman 2017-09-11 10:46:16 -04:00
parent 632770f104
commit 7af9c7cb00

View file

@ -33,6 +33,7 @@
- [continuous-subseqs](#continuous-subseqs)
- [filterer](#filterer)
- [if-path](#if-path)
- [index-nav](#index-nav)
- [keypath](#keypath)
- [multi-path](#multi-path)
- [must](#must)
@ -489,6 +490,22 @@ See also [if-path](#if-path)
()
```
## index-nav
Navigates to the index of the sequence if within 0 and size. Transforms move element
at that index to the new index, shifting other elements in the sequence.
`(index-nav index)`
```clojure
=> (select [(index-nav 0)] [1 2 3 4 5])
[0]
=> (select [(index-nav 7)] [1 2 3 4 5])
[]
=> (setval (index-nav 2) 0 [1 2 3 4 5])
[3 1 2 4 5]
```
## keypath
`(keypath key)`