[Ecls-list] flet/labels compiler/interpreter inconsistency

Brian Spilsbury brian.spilsbury at gmail.com
Mon May 8 17:27:01 UTC 2006


There seem to be two conventions used with the environment here.

The interpreter uses environment elements of the form

(NAME TYPE VALUE)

The compiler uses the interpreter's elements and adds in structures of
type REF (FUN and VAR).

This makes it difficult for the macroexpansion code written in C to
figure out that there is a function definition masking a macro
definition in this environment, etc.

There are two basic approaches to fixing this problem.

One is to make the environment more regular -- replacing #<a FUN: FOO>
with (FOO FUNCTION #<a FUN: FOO>, which will be ok as long as the
interpreter doesn't try to use that environment. Alternatively if that
is an issue, then (FOO FUNCTION-DEFINITION #<a FUN: FOO> might be
better.

The other option would be to teach macroexpand how to read the name of
#<a FUN: FOO> which looks like being significantly harder.

Another option would be for flet/labels to strip masked macros from
the environmnet for the region of their body, but I'm not recommending
it.

What do you think?

Regards,
Brian.

PS: This is a problem because local flets/labels should mask macro
definitions, and while the previous patch fixes macroexpansion, the
compiler's function definitions are invisible to it.




More information about the ecl-devel mailing list