Skip to content

clojure.core/map-indexed

View this page on ClojureDocs

Type: function Added: Clojure 1.2 Examples: 6 Runnable: 4
([f] [f coll])

Returns a lazy sequence consisting of the result of applying f to 0 and the first item of coll, followed by applying f to 1 and the second item in coll, etc, until coll is exhausted. Thus function f should accept 2 arguments, index and item. Returns a stateful transducer when no collection is provided.

Examples

by kredaxx on . May have evaluation errors.
by mmwaikar on . May have evaluation errors.
by freetonik on
by gluer on
by zackteo on
by Crowbrammer on

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.