2011-03-18 13:49:06 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
fn len(vec[mutable? int] v) -> uint {
|
|
|
|
auto i = 0u;
|
|
|
|
for (int x in v) {
|
|
|
|
i += 1u;
|
|
|
|
}
|
|
|
|
ret i;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-05-16 20:21:22 -05:00
|
|
|
auto v0 = [1, 2, 3, 4, 5];
|
2011-03-18 13:49:06 -05:00
|
|
|
log len(v0);
|
2011-05-16 20:21:22 -05:00
|
|
|
auto v1 = [mutable 1, 2, 3, 4, 5];
|
2011-03-18 13:49:06 -05:00
|
|
|
log len(v1);
|
|
|
|
}
|
|
|
|
|