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

Disappearance of COMPILER-LET



> From: waander@cs.umd.edu (Bill Andersen)
> Date: 12 Feb 92 04:09:20 GMT
> ....
>    3) Disappearance of COMPILER-LET in CLtL2, which is used heavily
>       in the code. (This is tough to get fixed)

It's easy to simulate COMPILER-LET using MACROLET, provided you can find all the
places that refer to the special variables bound by COMPILER-LET and change them.
I guess my code for doing this is only at home, so I can't send it to you, but in
outline the technique (due to Sandra Loosemore) is

  (compiler-let ((*foo* bar)) ....)
becomes a macro whose expansion function returns the value of
  `(macrolet ((foo-macro () ',bar)) ,@...)

and
  *foo*
referenced in a macro with an &environment argument named env becomes
  (macroexpand-1 '(foo-macro) env)

It makes sense to define macros to abstract the details, then the macros
can expand, based on a switch, into either the compiler-let technique or
the macrolet technique.