3 ms·
C doesn't exactly have macros. That's a text substitution done by the preprocessor in its own limited, special-purpose language. True hygienic macros of somethi
by cestith 5y ago
C doesn't exactly have macros. That's a text substitution done by the preprocessor in its own limited, special-purpose language. True hygienic macros of something like Common Lisp are a different beast.
If all you want are textual substitutions, you can use the C preprocessor in front of any language.
- FrozenVoid 5y agoC macros are as abstract or even more abstract than hygienic macros https://github.com/BlueFlo0d/CSP https://github.com/BlueFlo0d/CSP https://github.com/FrozenVoid/C-headers/blob/main/argmanip.h https://github.com/FrozenVoid/C-headers/blob/main/argmanip.h
- lispm 5y agoCommon Lisp does have macros, but not hygienic macros.
- cestith 5y agoThanks for the correction.
- kazinator 5y ago> you can use the C preprocessor in front of any language. You will be paddling upriver if that language doesn't have a mostly C-compatible token structure, or has white space sensitivities that C preprocessing doesn't preserve and such.
- shakna 5y agoThe C Preprocessor has sensitivities that aren't matched by C in all cases. And in the case of Hare, the tokenisation should be close enough to C that the CPP would only break in the same ways it already does.
- deleted 5y ago[deleted]