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 IntTuples.
This function zips two IntTuples 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 twoIntTuples 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 IntTuples.
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 twoIntTuples 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, origin4: 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 IntTuples.
This function zips three IntTuples 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, origin4: ImmutableOrigin](IntTuple[origin], IntTuple[origin], IntTuple[origin]) -> IntTuple): Function that takes threeIntTuples and returns anIntTuple`.
Args:
Returns:
IntTuple: A new IntTuple containing the results of applying func to each triplet.
apply_zip[func: fn[?, origin: ImmutableOrigin, origin2: ImmutableOrigin, origin4: 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 IntTuples.
This overload allows the function to capture variables from its environment.
Parameters:
- func (
fn[?, origin: ImmutableOrigin, origin2: ImmutableOrigin, origin4: ImmutableOrigin](IntTuple[origin], IntTuple[origin], IntTuple[origin]) capturing -> IntTuple): Capturing function that takes threeIntTuples and returns anIntTuple`.
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!