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