2011-03-18 13:49:06 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2011-08-12 17:42:39 -05:00
|
|
|
fn len(v: [mutable? int]) -> uint {
|
2011-07-27 07:19:39 -05:00
|
|
|
let i = 0u;
|
|
|
|
for x: int in v { i += 1u; }
|
2011-03-18 13:49:06 -05:00
|
|
|
ret i;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-08-12 17:42:39 -05:00
|
|
|
let v0 = ~[1, 2, 3, 4, 5];
|
2011-03-18 13:49:06 -05:00
|
|
|
log len(v0);
|
2011-08-12 17:42:39 -05:00
|
|
|
let v1 = ~[mutable 1, 2, 3, 4, 5];
|
2011-03-18 13:49:06 -05:00
|
|
|
log len(v1);
|
2011-06-15 13:19:50 -05:00
|
|
|
}
|