Life of a Computer Scientist: C preprocessor hygienic macros

https://lifecs.likai.org/2016/07/c-preprocessor-hygienic-macros.html

Life of a Computer Scientist Significant research starts with a humble beginning. corrects IE6 width calculation Sunday, July 10, 2016 A hygienic macro is a macro that defines variables for its own use without accidentally confusing them with the variables defined by the user of the macro. By design, C/C++ preprocessor macro performs only simple string substitution which is not hygienic. That means those using a macro has to be mindful of the macro's definition and avoid using variables of already used names. This also means that such macro cannot be arbitrarily nested in scope, since nesting will cause variable conflict. But hygienic macro is really useful for defining language extensions in the form of syntactic sugars....

Linked on 2023-07-05 18:51:59 | Similar Links