4 ms·
That's what macros are in Lisp and Scheme.
by gnaritas 11y ago
That's what macros are in Lisp and Scheme.
- kazagistar 11y agoMacros generate assembly?
- gnaritas 11y agoMacros generate code, any code you want, including inline assembly if the scheme supports inline assembly, if not no.
- sarmad 11y agoDoes scheme give you access to the compiler's internal data structures? Can you for example write an extension that scans through the compiled code looking for, say, for loops and replacing them with something else?
- gnaritas 11y agoMacro expansion happens just before compilation; you have the chance to alter the source code as it's being read by the reader just before compilation. But I see what you're getting at; you mean global modifications to the compiler to interpret the whole language differently. A macro allows you to make syntax, but it doesn't change the meaning of other syntax elsewhere in the program; only allows the programmer to add syntax to the language.