McCarthy's original Lisp and some number of incarnations开发者_StackOverflow thereafter did not have a macro facility like we now have in Common Lisp, Clojure, Scheme, etc... This I know.
However, it is unclear to me exactly how macros came to be, what implementation(s) had them first, and what motivated them. References to papers and source would be ideal if you please.
From The Evolution of Lisp (PDF):
Macros appear to have been introduced into Lisp by Timothy P. Hart in 1963 in a short MIT AI Memo [Hart, 1963]
See:
AIM-57 Author[s]: Timothy P. Hart
MACRO Definitions for LISP
October 1963
ftp://publications.ai.mit.edu/ai-publications/0-499/AIM-057.ps
ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-057.pdf
In LISP 1.5 special forms are used for three logically separate purposes: a) to reach the alist, b) to allow functions to have an indefinite number of arguments, and c) to keep arguments from being evaluated. New LISP interpreters can easily satisfy need (a) by making the alist a SPECIAL-type or APVAL-type entity. Uses (b) and (c) can be replaced by incorporating a MACRO instruction expander in define. I am proposing such an expander.
John Shutt's PhD thesis first part concerns the history of lisps, including the introduction of macros, I believe. It's not entirely clear to me on reading, but it seems that he claims that macros are more-or-less identified with an "extensible languages" movement (which is independent of lisp), and that M.D. McIlroy's 1960 paper, "Macro Extension Instructions of Compiler Languages", was foundational to the extensible languages movement... implying that macros were introduced to the academic literature in 1960.
精彩评论