@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
Syntax
Section titled “Syntax”@lang:zip(a b)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
a | array | First array to zip |
b | array | Second array to zip |
See Also
Section titled “See Also”- @unzip — split pairs into two arrays
- @enumerate — pair elements with indices
On-chain face (@zip!)
Section titled “On-chain face (@zip!)”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.