/* * dollar sign identifiers are only valid within a macro body (what i believe * scheme folk call "hygienic") */ macro SWAP($a, $b) { let $tmp = $a $a := b $b := $tmp } proc foo(n ^Node) { SWAP(&n^.in.data[0], &n^.in.data[1]) } /* * note that the macro body between the braces isn't a new scope, so you can * still e.g. have a macro that defines a variable. or, perhaps, a function: */ macro V2OP($name, $op) { func $name(a, b vec2) vec2 { return vec2 { a.x $op b.x, a.y $op b.y } } }