Given the macro matching example, this shows how macros can match an argument.
I\'ve made very minor changes here to use numbers:
macro_rules! foo {
No.
Macros operate on the Abstract Syntax Tree, so they reason at the syntactic level: they reason about tokens and their spelling.
For example:
fn main() {
let v = 3;
}
In this case, the AST will look something like:
fn main
\_ let-binding v
\_ literal 3
If you ask a macro whether v
is 3
, it will look at you funny, and wonder why you would try comparing a variable name and a literal.