Logo

Programming-Idioms

History of Idiom 143 > diff from v13 to v14

Edit summary for version 14 by Xris:
New Rust implementation by user [Xris]

Version 13

2018-03-27, 11:45:39

Version 14

2018-03-27, 11:50:35

Idiom #143 Iterate alternatively over two lists

Iterate alternatively over the elements of the list items1 and items2. For each iteration, print the element.

Explain what happens if items1 and items2 have different size.

Idiom #143 Iterate alternatively over two lists

Iterate alternatively over the elements of the list items1 and items2. For each iteration, print the element.

Explain what happens if items1 and items2 have different size.

Extra Keywords
parallel
Extra Keywords
parallel
Imports
extern crate itertools;
Code
for pair in izip!(item1, item2) {
    println!("{:?}", pair);
}