Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What are “hygienic” macros?

hygienic macros
0
Posted

What are “hygienic” macros?

0

The term “hygienic” has been used in connection with macros since the mid 1980s, if not earlier. Broadly speaking, hygienic macros are macros whose expansion is guaranteed to not cause collisions with definitions already existing in the surrounding environment. Kent Dybvig in [Writing Hygienic Macros in Scheme with Syntax-Case] defines macro hygiene as follows: If a macro transformer inserts a binding for an identifier, the new binding will not capture other identifiers of the same name introduced elsewhere. He also defines referential transparency with respect to macros as If a macro transformer inserts a free reference to an identifier, the reference refers to the binding that was visible where the transformer was specified, regardless of any local bindings that may surround the use of the macro. In practice, the term “hygienic macros” usually refers to macros that are both hygienic and referentially transparent according to the above definitions. Hygienic macros were an optional par

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.