I have been using Clojure alot recently but I still don't understand what functionality I do not get that common lisp reader macros provide. Can explain explain this to me in simple terms?
In short, reader macros provide you with the ability to redefine the programming language's syntax within some delimited context.
For example, you could implement regular expression literals (e.g. #"pattern"
) yourself given reader macros. Without them, you would be forced to properly escape regular expressions in string literals passed to re-pattern
.
BTW, while there are no public Clojure APIs for modifying the reader, it's not impossible, as illustrated in these posts: