3 ms·
The readtables and reader macros are entirely independent of Common Lisp compilers. The compilers work on the representation (that is, trees of cons cells) tha
by pfdietz 3y ago
The readtables and reader macros are entirely independent of Common Lisp compilers. The compilers work on the representation (that is, trees of cons cells) that is produced by the reader, which is after the readtables and reader macros have done their work.
If you are thinking of a Common Lisp compiler as working on a text file, you're thinking about it wrong. In Common Lisp, you can invoke the COMPILE function on a lambda expression that you cons up at runtime and that never is in a textual representation.
As a general rule, don't reimplement a Lisp except as a learning exercise (in which case, you're not going to reimplement Common Lisp; it's too big.)
- HexDecOctBin 3y ago> In Common Lisp, you can invoke the COMPILE function on a lambda expression that you cons up at runtime and that never is in a textual representation. Ah, I see. This actually clarified some of the apparently contradictory stuff I have been reading, thanks. > As a general rule, don't reimplement a Lisp except as a learning exercise Oh, I am much too nuts for something as simple as that, I am actually planning to write a GPU-targeted language with ALGOL-syntax and Lisp-metaprogramming and REPL-driven-ish development. Wish me luck!
- el_memorioso 3y agoWhy m-expressions (Algol syntax)? McCarthy initially tried m-expressions for Lisp, but it turned out that programmers liked s-expressions better.
- pfdietz 3y agoIn particular, macros work great with s-expressions, not so great with m-expressions.
- HexDecOctBin 3y agoThere has been some new research around this old problem, which inspired me: https://dl.acm.org/doi/10.1145/3622818 https://dl.acm.org/doi/10.1145/3622818
- rokkitmensch 3y agoI salute your honest madness.