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

Compiling CASE

I think that this entire issue has been blown up out of porportion.
For one thing, there aren't many macros that there is a really good
reason for compiler to special-case: MULTIPLE-VALUE-BIND, OR and
xxxCASE are the main examples.  It is feasible to avoid
special-casing even these.

Note also that writers of portable code walkers can anticipate that
certain macros may want to be special-cased by incorporating knowledge
about their syntax.  The code walker doesn't need to do this, but the
resulting code may perform better in some implementations.  The code
walker will still work even if the macro really is just a macro

The significance of code walkers has also been exaggerated.  For one
thing, modern Lisp compilers tend not to use source code as the
internal representation, and their operation cannot really be modeled
as a source code walk.  Given a sufficiently rich representation, many
things can be determined without actually grovelling the code.

Of course internal compiler representations are highly implementation
dependent, but this isn't necessarily a problem.  One of the main
things that source code walkers have been used for is writing
"optimizing macros" for non-optimizing compilers.  As long as the
compiler adequately optimizes the code, macros can expand in a
simple-minded way without understanding their arguments.