|
|
|
|
|
by pfdietz
45 days ago
|
|
Think of macros as what you want when you want to perform computation at compile time rather than run time. An example: building the equivalent of a switch statement, but that compares (via string equality) with a set of strings. The macro would translate this into code that would do something like a decision tree on string length or particular characters at particular positions. Basically anything that's done with a preprocessor in another language can be done with macros in Lisp family languages. |
|