Zipped Lists (Expression) — skLambda

Addon: skLambda · Category: Expression · Since: 1.2.0

Syntax

%objects% zipped with %objects% (with|using|through) %object%

Description

Walks two lists in lockstep, combining each pair of elements with a two-argument value lambda and returning a new list of the results. The lambda is invoked once per index with the matching elements as its two arguments. Iteration stops at the shorter list, and results whose lambda returns nothing are dropped.

Examples

# {_add} = lambda (a: number, b: number) -> number: return {_a} + {_b}
set {_sums::*} to (1, 2, 3) zipped with (10, 20, 30) using {_add}
# 11, 22, 33

View source