diff --git a/List-of-Navigators.md b/List-of-Navigators.md index 147e866..2e3eb93 100644 --- a/List-of-Navigators.md +++ b/List-of-Navigators.md @@ -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)`