[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Macros in Lisp

Daniel Ranson presented a very good list of suggested uses for macros.  Among
them is one that should be emphasized, namely to develop your own language.  A
common way for good Lisp programmers to solve problems is to first define and
implement the best possible language for stating the problem and its solutions
and then program in that language.  Macros allow you to do that kind of thing
more easily.  I once implemented a logical query language based on syntax
developed by James Slagle (U. of Minnesota) and by using an extensive number of
macros was able to use his syntax virtually unmodified. That let users create
files that could be directly loaded or compiled.  Macros won't replace parsers
for large languages, but for modest sized ones they are a valuable tool.

Paul Krueger (plkrueger@3m.com)