2010-06-23 23:03:09 -05:00
|
|
|
fn main() {
|
|
|
|
|
|
|
|
obj buf(vec[u8] data) {
|
|
|
|
fn get(int i) -> u8 {
|
|
|
|
ret data.(i);
|
|
|
|
}
|
|
|
|
}
|
2011-05-16 20:21:22 -05:00
|
|
|
auto b = buf([1 as u8, 2 as u8, 3 as u8]);
|
2010-06-23 23:03:09 -05:00
|
|
|
log b.get(1);
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (b.get(1) == (2 as u8));
|
2010-07-26 17:20:13 -05:00
|
|
|
}
|