summary refs log tree commit diff
path: root/src/test/run-pass/macro-by-example-1.rs
blob: 520adef92ebe078f86bac3e5f7acb5bc5dcf1f6f (plain)
1
2
3
4
5
6
7
fn main() {
    #macro[[#apply[f, [x, ...]], f(x, ...)]];

    fn add(a: int, b: int) -> int { ret a + b; }

    assert (#apply[add, [1, 15]] == 16);
}