Basically after https://github.com/Veykril/tlborm/pull/43 lands, the hygiene subchapter of the syntax extension chapter is still a lot worse than the declarative macros one. Feels like a lot of information from the declarative one should be lifted into the syntax extension one?
Just opened #78 on the duplicated evaluation problem, which might be part of the hygiene chapter.
What is so bad about the chapter?
What I got from it is:
it's bad to rely within the macro on things defined outside the macro (like assuming a specific variable is there)
it's bad to change the things outside the of the scope of the macro (like creating variables)
Rust allows you to do those bad things, so you are responsible.
It's really not great atm but I'm currently having trouble going into the topic without touching macro_rules!/proc-macro specifics, https://veykril.github.io/tlborm/syntax-extensions/hygiene.html
Basically after https://github.com/Veykril/tlborm/pull/43 lands, the hygiene subchapter of the syntax extension chapter is still a lot worse than the declarative macros one. Feels like a lot of information from the declarative one should be lifted into the syntax extension one?