Quoting symbols in a local scope

These examples are something good to understand but they are not very good for explaining macro usage. The first error you get is due to eval evaluating in global scope, not due to the macro. In fact @eval have very different evaluation semantics than most other macros so you shouldn’t use it to understand macro’s evaluation rules in general.

Quoting symbols do NOT behave different in local scope, the only difference you observe above is due to eval. As for interpolation, quoting should generally preserve the indentity of the object, including symbols. They just may not be needed when the object doesn’t have special meaning in the AST. This is why the last one works and the second last doesn’t.

2 Likes