Hacker News new | ask | show | jobs
by varajelle 1911 days ago
That's true about the pure act of parsing and generating an AST. Bit once we want to do semantic analysis, this is no longer true.

Because of procedural macro, it becomes practically impossible to find all occurrences or rename a particular symbol regardless of the #ifdef or #[cfg] or whatever.

1 comments

So with true hygienic macros, this is not the case. Even with procedural macros, quoted identifiers are resolved where they are quoted not where they are expanded. Identifiers that are not in scope at the macro definition site would have to be parameters, and those are caught at the invocation site just like any other identifier (the quote and splice cancel out).

I am not sure whether Rust procedural macros are always that hygienic, so fair point if they aren't.