Bear in mind, you can nest one zip
inside another, and then unpack it with a nested tuple:
let integers = [1, 2, 3, 4, 5]
let strings = ["a", "b", "c", "d", "e"]
let doubles = [1.0, 2.0, 3.0, 4.0, 5.0]
for (integer, (string, double)) in zip(integers, zip(strings, doubles)) {
print("(integer) (string) (double)")
}
Not quite as elegant as having a zip
for arbitrary n-tuples, but it gets the job done.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…