Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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