Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Implement a Lisp macro system

Name: Anonymous 2015-05-31 12:09

/prog/, do you know of a tutorial or a paper on implementing a Lisp macro system from scratch? It could be Scheme macros, it could be really simple macros, anything would be helpful.

Name: Anonymous 2015-05-31 20:51

>>18
Functions and macros are two different things. When you see a function call while compiling code, you don't need to know what the function is at compile time (unless you want to inline). You just need to know that the name refers to a function, and you can give it the right address to jump to later. But when you encounter a macro during compilation, you need to know what the macro is, or you can't continue compilation. Your only choice is to delay compilation of the function until you know the definition of the macro. So it's hard. You could try to solve the problem, and it is solvable to an extent, but you will have to report errors for macros that attempt to use each other cyclically.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List