ClojureDocs

导航

命名空间

map-indexed

clojure.core

在 1.2 中提供 ()
  • (map-indexed f)
  • (map-indexed 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.