Macros and Metaprogramming

In the same issue of CACM, a short-lived extensible-languages movement was kicked off by M. Douglas McIlroy with Macro Instruction Extensions of Compiler Languages [McI60].[76] Given Lisp’s sparse syntax and limited core feature set—and corresponding appetite for language extension—it was natural that three years later Timothy Hart would propose macros for addition to Lisp.[77]

Since Lisp code is also data, its users were already metaprogramming. The addition of macros after Lisp 1.5 added a macro-expansion phase to the interpretation of Lisp programs, giving things roughly the shape we see today. Macros provided for a faster path for programmers to extend Lisp. They could redefine core features on not much more ...

Get Clojure Applied 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.