Macros-by-example expr
metavariable substitution behaves as if parenthesized
#1372
Labels
A-macros
Area: Macros
While reviewing some code, I saw a macro-by-example using a metavariable of type
expr
in such a way that the code would be wrong if an expression were given to the macro that needed to be parenthesized — so I thought. Testing in the Playground, I found that substituted expressions appeared to be parenthesized automatically. I checked the Reference's section on macros-by-example and saw nothing about this; I looked at the Book's section on macros-by-example and saw nothing about this, but the Book suggested for further reading https://veykril.github.io/tlborm/, which explains that expressions are substituted as AST nodes rather than as tokens and so behave as if parenthesized. I suggest that this be mentioned in the Reference.The text was updated successfully, but these errors were encountered: