Skip to content

@lang:zip

Combine two arrays element-wise into an array of pairs.

On-chain (@lang:zip!): Either or both sides may be live, a length mismatch reverts, and the result retains the type of each lane.

Returns: array

@lang:zip(a b)
NameTypeDescription
aarrayFirst array to zip
barraySecond array to zip
  • @unzip — split pairs into two arrays
  • @enumerate — pair elements with indices

Pair two equally sized arrays in order. Unequal lengths fail in both modes. Each lane retains its own type, including multiword types. With one live side the call is spliced with build-time offsets; with two it goes through the core's get, which resolves each side once in its own frame rather than re-reading the first to place the second.