by grumpyprole · 4y ago · 0 comments
But I don't think this is a bad example at all, I tend to think of macros as "extending the language/compiler", since they have access to the abstract syntax tree of their inputs, which is what is being done here.
It doesn't matter what specific combination of language features are supported. Macros mean you can implement things anyway. It doesn't really matter what the evaluation logic of the language is, a macro can create syntax that does what you want it to.
If there is a macro system available, a new operator can be implemented in any language. If there is no macro system, it depends what features the language supports.