3 ms·
The important thing about reader macros is that they happen at read time. It causes code to be executed at tokenizing time (so you can make your own syntax, e.
by gumby 6y ago
The important thing about reader macros is that they happen at read time. It causes code to be executed at tokenizing time (so you can make your own syntax, e.g. #{ ... } could return a JSON object directly) even before evaluation or macroexpansion.
So #+ and #- really only scratch the surface. Someone wrote a comment about using #+ to define the path delimiter (/ or \), but that is something that could be looked up at runtime. Read-time extension is unusual in programming languages (C++ has such a feature for a more limited set of cases).