![]() | Fun 0.41.5 The programming language that makes You have fun |
Iterator-style helpers exposed as built-ins (enumerate, zip). More...


Go to the source code of this file.
Functions | |
| Value | bi_enumerate (const Value *arr) |
| Build an array of [index, value] pairs from an input array. | |
| Value | bi_zip (const Value *a, const Value *b) |
| Zip two arrays into an array of pairs up to the shorter length. | |
Iterator-style helpers exposed as built-ins (enumerate, zip).
Definition in file iter.c.
Build an array of [index, value] pairs from an input array.
For an input array [v0, v1, ...], returns [[0, v0], [1, v1], ...]. Non-array inputs are treated as empty arrays by array_length/array_get_copy.
Ownership: The returned Value owns its internal array; caller must free it with free_value().
Definition at line 30 of file iter.c.

Zip two arrays into an array of pairs up to the shorter length.
For inputs a=[a0,a1,...], b=[b0,b1,...], returns [[a0,b0],[a1,b1], ...] with length min(len(a), len(b)).
Ownership: The returned Value owns its internal array; caller must free it with free_value().
Definition at line 66 of file iter.c.
