Utilities for interpreting/normalizing indices for range commands, e.g. LRANGE, ZRANGE
Utilities for interpreting/normalizing indices for range commands, e.g. LRANGE, ZRANGE
(indices-for xs start stop)
Normalize user-specified indices into a range of positive indices It is up to the user to check for additional error cases as necessary
Normalize user-specified indices into a range of positive indices It is up to the user to check for additional error cases as necessary
(normalized-start-idx xs start)
Given an start idx which may be negative (indicating offset from the end) or exceed the size of xs, return a normalized positive 0-based idx
Semantics for start differ from end - e.g. LRANGE specifies that start > last-idx = empty list
Given an start idx which may be negative (indicating offset from the end) or exceed the size of xs, return a normalized positive 0-based idx Semantics for start differ from end - e.g. LRANGE specifies that start > last-idx = empty list
(normalized-stop-idx xs stop)
Given a stop idx which may be negative (indicating offset from the end) or exceed the size of xs, return a normalized positive 0-based idx
Semantics for stop differ from start - e.g. LRANGE specifies that stop > last-idx = treat like last idx
Given a stop idx which may be negative (indicating offset from the end) or exceed the size of xs, return a normalized positive 0-based idx Semantics for stop differ from start - e.g. LRANGE specifies that stop > last-idx = treat like last idx
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close