3 ms·
Virtually nothing requires reader macros. That doesn't mean they aren't useful. Personally if I wanted reader macros in clojure I wouldn't bother implementing
by azrazalea 10y ago
Virtually nothing requires reader macros. That doesn't mean they aren't useful.
Personally if I wanted reader macros in clojure I wouldn't bother implementing them because it wouldn't be worth the pain to me. However, if clojure had them I/libraries would likely make good use of them.
- emidln 10y agoIt has a reader as a library. It's entirely possible for you to change its lookup map to a defmethod and go to town altering s-expressions for arbitrary syntax if you wish. You're not hacking a new reader here, you'd refactoring something that probably should have been a generic method to begin with into one. Nobody has bothered with this because it's not useful to anyone, as far as I can tell. People who want non-data syntax write it with clj-antlr/instaparse (which are very easy to use) and use a macro when they want to interleave it into their code. These universally end up with a data-based AST that is readable and printable.