What You've Learned

This chapter covered macro programming. You’ve learned the following:

  • Macros let you write code that writes code. With macros, you can create your own programming language and convert it to standard Lisp just before the compiler can get a peek at it.

  • Macros allow you to get rid of that feeling of déjà vu when writing your code, in situations when nothing else can do so.

  • You must be careful when writing macros so that they don’t lead to unintentional, repeated execution of code.

  • You need to be careful to avoid unintended variable capture in macros. You can avoid this by using gensym names.

  • If variables created by a macro are exposed on purpose, as a feature of the macro, the macro is called an anaphoric macro.

  • Macro programming is ...

Get Land of Lisp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.