Brad Cox's Quasi Literals For Java
|
|
Brad Cox of Objective-C fame has written a preprocessor for Java (see Java+ Preprocessor). The peculiarly unique piece about this preprocessor is the way it does Quasi-Literals. To learn more about Quasi-Literals head over to "Why Quasi-Literals?".
Brad Cox adds a twist on Quasi-Literals, allowing for recursive applicaton based on user defined string pairs. Take a look at the explanation, it handles multi-line strings and i18n quite cleanly.
Its a nice mechanism to keep in mind, just in case we upgrade the Java language.
Incidentally, Quasi-Literals are the proper abstractions to use for defining macros, in particularly Hygienic Macros. JSE uses Quasi-Literals albeit with a different syntax.

