[Ecls-list] Bug in local macros

Juan Jose Garcia Ripoll lisp at arrakis.es
Mon Jun 12 08:38:02 UTC 2006


On Tue, 2006-06-06 at 09:12 +0200, Pascal Costanza wrote:
> > There is a bug with local macro definitions in ecl. The HyperSpec
> > says this:
> >
> > "The macro-expansion functions defined by macrolet are defined in the
> > lexical environment in which the macrolet form appears. Declarations
> > and macrolet and symbol-macrolet definitions affect the local macro
> > definitions in a macrolet, [...]."
> >
> > The following test cases shows that enclosing symbol-macrolet
> > definitions only have an effect for interpreted code, and enclosing
> > macrolet definitions never have an effect.

I followed the thread in comp.lang.lisp. Actually, the fact that it
works in the interpreter is rather accidental: I had always a more
restricted view of macrolet in mind, in which the enclosing macrolet and
symbol-macro definitions appear in the environment and do affect how the
output of these macros is later on expanded.

I see no point in these macros also affecting the macrolet functions
themselves. Indeed, this seems quite dangerous, superfluous and
restricting. I am just thinking about possible optimizations of
call-next-method, slot-value, etc, using macrolet. This sort of prevents
it completely because some of these functions may appear in the macros
themselves.

In any case, I will just follow what everybody else does and fix it. It
will be a two-steps process. I first must ensure that the bytecodes
compiler and the C compiler use a similar kind of environments. This is
almost done. The second step will be to teach macrolet how to build the
functions using the environment of the C compiler.

Regards,

Juanjo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060612/9696f761/attachment.sig>


More information about the ecl-devel mailing list