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

Re: RE: succinctness = power

On Sun, 26 May 2002, Matthias Felleisen wrote:

> Otherwise Shriram is head-on. Patternistas :) do what Paul does.
> They just don't understand the role of macros, but some will!

Many patterns (design and otherwise) don't lend themselves well to being
captured by lisp macros and similar mechanisms, which are constrained to
have purely local effects - that is, they can only transform source code
inside their lexical scope.  Their composability is also quite limited (a
good example of this is the various CL macros out there that wrap
defclass; how do you use features from two of them at once?).

Andrew Catton and I developed a tool called ELIDE last year which allows
macro-like transformations on Java that don't have these limitations:
parameterized annotations can be attached to any source construct, which
trigger transformations whose scope is limited only by the developer's
good sense.  A trivial example we use is a "visited" annotation on a
class, which adds both the accept() method to that class and the
appropiate visit() method to the visitor interface.

We termed the process of finding patterns and encapsulating them in such
transformations "Explicit Programming".  More information, including the
AOSD paper, is available from
http://www.cs.ubc.ca/labs/spl/projects/explicit.html .