4 ms·
There is something very wrong with the concept of 'runtime' macros. How is a 'runtime' macro any better than a function/procedure? TBH, I have no idea what a us
by leppie 14y ago
There is something very wrong with the concept of 'runtime' macros. How is a 'runtime' macro any better than a function/procedure? TBH, I have no idea what a use case would be for a 'runtime' macro. A macro is generally a compile-time source transformation. If you need that at runtime, use EVAL.
- Patient0 14y agoTo me it's because they provide a simple way to solve the hygiene problem in an interpreter. That is, it's easier to implement first-class macros (which allow hygiene) in an intepreter , than it is to implement scheme-style non-first-class hygienic macros... I only say this because I know how to implement first-class macros, but I don't really understand how Scheme's hygienic macros work...
- Oxryly 14y agoOne difference is that macros (whether run-time or compile-time) use a call-by-name evaluation strategy. Hence they are a form of lazy evaluation. Functions (in scheme and lisp) are call-by-value IIRC.