2011-03-18 13:49:06 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2012-06-25 22:00:46 -05:00
|
|
|
fn len(v: [const int]/~) -> uint {
|
2012-03-22 10:39:41 -05:00
|
|
|
let mut i = 0u;
|
2012-06-04 12:44:19 -05:00
|
|
|
while i < vec::len(v) { i += 1u; }
|
2011-03-18 13:49:06 -05:00
|
|
|
ret i;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-25 22:00:46 -05:00
|
|
|
let v0 = [1, 2, 3, 4, 5]/~;
|
2011-12-22 19:53:53 -06:00
|
|
|
log(debug, len(v0));
|
2012-06-25 22:00:46 -05:00
|
|
|
let v1 = [mut 1, 2, 3, 4, 5]/~;
|
2011-12-22 19:53:53 -06:00
|
|
|
log(debug, len(v1));
|
2011-08-15 23:54:52 -05:00
|
|
|
}
|