518dc52f85
This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
19 lines
307 B
Rust
19 lines
307 B
Rust
// -*- rust -*-
|
|
type point = (int, int);
|
|
|
|
fn f(p: point, x: int, y: int) {
|
|
let (a, b) = p;
|
|
assert (a == x);
|
|
assert (b == y);
|
|
}
|
|
|
|
fn main() {
|
|
let p: point = (10, 20);
|
|
let (a, b) = p;
|
|
assert (a == 10);
|
|
assert (b == 20);
|
|
let p2: point = p;
|
|
f(p, 10, 20);
|
|
f(p2, 10, 20);
|
|
}
|