2011-03-18 11:49:06 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2011-11-16 13:52:08 -08:00
|
|
|
fn len(v: [const int]) -> uint {
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut i = 0u;
|
2011-08-15 21:54:52 -07:00
|
|
|
for x: int in v { i += 1u; }
|
2011-03-18 11:49:06 -07:00
|
|
|
ret i;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-08-19 15:16:48 -07:00
|
|
|
let v0 = [1, 2, 3, 4, 5];
|
2011-12-22 17:53:53 -08:00
|
|
|
log(debug, len(v0));
|
2012-03-26 18:35:18 -07:00
|
|
|
let v1 = [mut 1, 2, 3, 4, 5];
|
2011-12-22 17:53:53 -08:00
|
|
|
log(debug, len(v1));
|
2011-08-15 21:54:52 -07:00
|
|
|
}
|