Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: map-params , Previous: map-all-pairs , Up: M , Home: Overview

Clamps Dictionary

map-indexed

Macro

(map-indexed result-type fn &rest seqs)

Map fn over seqs with incrementing zero-based idx. The idx will get supplied as first arg to fn. result-type serves the same purpose as in #'map.

Arguments

result-type Result type to return. If nil, don't return a result.
fn Function to map over sequences. Needs to accept (+ 1 (length seqs)) arguments.
seqs One or more sequences where mapping gets applied, similar to map.

Example

(map-indexed 'list #'list '(a b c d e)  '(20 10 30 50 40))
;; => ((0 a 20) (1 b 10) (2 c 30) (3 d 50) (4 e 40))

Author: Orm Finnendahl

Created: 2025-02-18 Di 12:58

Validate