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 is a flat word-pair payload, so @len! counts words rather than pairs.

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

Interleave two word payloads on-chain through zipWords. Either side, or both, may be live (a call or nested face) or a constant array literal. When both are live the second offset is computed on-chain from the first payload's length. A word-count mismatch reverts with WordCountMismatch.

load lang
set $amm 0x44fA8E6f47987339850636F88629646662444217
assert @zip!($amm::{caps()(uint256[])} [7 8]) == 0x1122
  • assert, @unzip!