[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pattern-matching and programs
In discussion of macro systems recently, some people have complained
that pattern-matching macro systems make decomposing macros too hard:
> When all you've got is simple pattern matching, complex
> transformations require pages of helper macros. Dylan's FOR loop,
> for example, requires about 5 pages of dense macrology to support a
> tiny fraction of the features provided by LISP's LOOP macro.
(Eric Kidd wrote the above, but others seemed to agree.)
I recently read the Aardappel thesis (at
http://wouter.fov120.com/aardappel). It discusses a fascinating
programming language entirely based on pattern-matching; it appears
that programming in a language like Aardappel would feel a lot like
programming in a pure functional language. It doesn't appear to lack
abstraction facilities; its concessions to ease of programming appear
to include only syntactic sugar for "local rules" (by name mangling),
a "let" form (by turning local rules inside out) and a conditional
operator (which expands into a few local rules.)
Could a similar small addition to Dylan's macro-defining sublanguage
reduce the FOR definition to a reasonable size?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Edsger Wybe Dijkstra died in August of 2002. The world has lost a great
man. See http://advogato.org/person/raph/diary.html?start=252 and
http://www.kode-fu.com/geek/2002_08_04_archive.shtml for details.