6

On my way to learn Lisp I have discovered the all powerful and feared so called Macros, then after spending a hard time trying to understand them and their usefulness I said to myself, I FINALLY GOT IT.
I couldn't be more wrong, I was thinking that the only purpose of Macros was to define new control structures and that was all I needed to know until I start reading more and more on the subject and a whole new world has comes to me !

One can use Macros for new Domain Specific Language, Code Transformation and to avoid Boilerplate Code.

Hence, if a few examples at which the aforementioned usages of macros and others as well, with a concise and simple-to-understand explanation could be given it would be really nice.

1 Answer 1

4

The canonical reference for LISP macros is On Lisp: Advanced Techniques for Common Lisp, by Paul Graham (book version). It is out of print, and everyone who owns a copy knows what it is worth. You can download it, but Paul says nine figures got lost somewhere in the ozone.

Let Over Lambda, by Doug Hoyte, is also good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.