2012-08-08 21:41:50 -05:00
|
|
|
const x : [int]/4 = [1,2,3,4];
|
|
|
|
const p : int = x[2];
|
2012-08-09 18:05:34 -05:00
|
|
|
const y : &[int] = &[1,2,3,4];
|
2012-08-08 21:41:50 -05:00
|
|
|
const q : int = y[2];
|
|
|
|
|
|
|
|
const s : {a: int, b: int} = {a: 10, b: 20};
|
|
|
|
const t : int = s.b;
|
|
|
|
|
|
|
|
fn main() {
|
2012-08-09 18:05:34 -05:00
|
|
|
io::println(fmt!("%?", p));
|
|
|
|
io::println(fmt!("%?", q));
|
2012-08-08 21:41:50 -05:00
|
|
|
io::println(fmt!("%?", t));
|
2012-08-09 18:05:34 -05:00
|
|
|
assert p == 3;
|
|
|
|
assert q == 3;
|
2012-08-08 21:41:50 -05:00
|
|
|
assert t == 20;
|
|
|
|
}
|