|
|
|
|
|
by ljackman
2707 days ago
|
|
This approach being even viable is a testament to the host platform portability of Clojure, but even more to Common Lisp's ability to read other language's token-level syntax via reader macros (unless I've misunderstood how this projects ports Clojure to CL). Reader macros in CL allow it to implement much of Clojure, but Clojure's lack of them means it could never implement CL unless it implemented built-in readers to handle every possible reader macro that a CL implementation loaded in. As arbitrary library code can access the reader in CL, this would apparently be impossible. I suppose it comes down to whether a Lisp dialect wants to support arbitrarily-powerful metalinguistic abstractions in its own Lisp syntax or provide the ability to create whole new languages with different fundamental tokens. If a dialect only wants to achieve the former but has no interest in the latter, AST macros would suffice and custom reader macros would be of little interest, which is presumably the reasoning behind Clojure's lack of them. Anyway, kudos for a great project. |
|
The Clojure syntax is sufficiently different from Common Lisp, so that it might be a pain to implement that syntax as reader macros.
Generally I would think that reader macros are not a general mechanism to implement Lisp-like syntax, but specifically Common Lisp lexical syntax and extending/modifying it.