Is it possible to write a macro:
my_macro!(left + right)
that gets transformed into:
{
let left = 0;
let right = 1;
$expr
}
where the variables are defined inside the macro? The user of the macro knows that left and right are special variable names.
A declarative macro can't because of hygiene, but a very basic procedual macro can:
when called with:
will print "2".