Created
May 19, 2011 23:22
-
-
Save eholk/982018 to your computer and use it in GitHub Desktop.
Backwards while loop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std; | |
import std::vec; | |
fn main() { | |
auto v = [1, 2]; | |
auto i = vec::len[int](v) - 1u; | |
while (i != 0u) { | |
log_err i; | |
log_err v.(i); | |
i -= 1u; | |
} | |
assert i == 0u; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment