for each loop don't work in 3.0 and trunk:
for each(~[2, 4, 8, 5, 16]) |n| {
if n % 2 != 0 {
println(~"found odd number!");
break;
}
}
http://dl.rust-lang.org/doc/tutorial.html#for-loops
also it is possible to get the value from this loop:
import io::println;
fn main() {
for 5.times {
println("Here's some Rust!");
}
}
for example:
for 5.times |i|{
println(i+"Here's some Rust!");
}
Thanks
Nadav
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev