This snippet prints $i
, but I would like it to print foo
. I've tried a few variations on this theme which didn't work, nor was I able to find anything in the documentation about this behavior. Is there syntax to make this possible?
macro_rules! print_ident {
($i:ident) => {
println!("$i");
};
}
fn main() {
print_ident!(foo);
}