Mojo function
apply_zip
apply_zip[func: fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin](IntTuple[origin], IntTuple[origin]) -> IntTuple](t1: IntTuple[origin], t2: IntTuple[origin]) -> IntTuple
Apply a function to pairs of elements from two IntTuple
s.
This function zips two IntTuple
s together and applies the given function
to each pair of elements, creating a new IntTuple
with the results.
Parameters:
- func (
fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin](IntTuple[origin], IntTuple[origin]) -> IntTuple
): Function that takes twoIntTuple
s and returns anIntTuple
.
Args:
Returns:
IntTuple
: A new IntTuple
containing the results of applying func to each pair.
apply_zip[func: fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin](IntTuple[origin], IntTuple[origin]) capturing -> IntTuple](t1: IntTuple[origin], t2: IntTuple[origin]) -> IntTuple
Apply a capturing function to pairs of elements from two IntTuple
s.
This overload allows the function to capture variables from its environment.
Parameters:
- func (
fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin](IntTuple[origin], IntTuple[origin]) capturing -> IntTuple
): Capturing function that takes twoIntTuple
s and returns anIntTuple
.
Args:
Returns:
IntTuple
: A new IntTuple
containing the results of applying func to each pair.
apply_zip[func: fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin, origin
4: ImmutableOrigin](IntTuple[origin], IntTuple[origin], IntTuple[origin]) -> IntTuple](t1: IntTuple[origin], t2: IntTuple[origin], t3: IntTuple[origin]) -> IntTuple`
Apply a function to triplets of elements from three IntTuple
s.
This function zips three IntTuple
s together and applies the given function
to each triplet of elements, creating a new IntTuple
with the results.
Parameters:
- func (
fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin, origin
4: ImmutableOrigin](IntTuple[origin], IntTuple[origin], IntTuple[origin]) -> IntTuple): Function that takes three
IntTuples and returns an
IntTuple`.
Args:
Returns:
IntTuple
: A new IntTuple
containing the results of applying func to each triplet.
apply_zip[func: fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin, origin
4: ImmutableOrigin](IntTuple[origin], IntTuple[origin], IntTuple[origin]) capturing -> IntTuple](t1: IntTuple[origin], t2: IntTuple[origin], t3: IntTuple[origin]) -> IntTuple`
Apply a capturing function to triplets of elements from three IntTuple
s.
This overload allows the function to capture variables from its environment.
Parameters:
- func (
fn[?, origin
: ImmutableOrigin, origin2: ImmutableOrigin, origin
4: ImmutableOrigin](IntTuple[origin], IntTuple[origin], IntTuple[origin]) capturing -> IntTuple): Capturing function that takes three
IntTuples and returns an
IntTuple`.
Args:
Returns:
IntTuple
: A new IntTuple
containing the results of applying func to each triplet.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!