Document index-nav.
This commit is contained in:
parent
632770f104
commit
7af9c7cb00
1 changed files with 17 additions and 0 deletions
|
|
@ -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)`
|
||||
|
|
|
|||
Loading…
Reference in a new issue