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 {
|
2012-03-22 10:39:41 -05:00
|
|
|
let mut i = 0u;
|
2012-04-06 13:01:43 -05:00
|
|
|
for v.each {|x| 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));
|
2012-03-26 20:35:18 -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
|
|
|
}
|