In this example:
macro swap {
rule { ($x, $y) } => {
var tmp = $x;
$x = $y;
$y = tmp;
}
}
var foo = 5;
var tmp = 6;
swap(foo, tmp);
the article says it expands to this: var foo = 5;
var tmp$1 = 6;
var tmp$2 = foo;
foo = tmp$1;
tmp$1 = tmp$2;
Is that really true? The statement "var tmp = 6" appears in the source code before the place the macro is invoked. Can a sweet macro reach back and modify statements that occurred earlier in the file?