Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.