Tue Mar 8 18:18:17 EST 2011

Macros in terms of multiple signatures

I'd like to have a simpler explanation of why macros in signatures
can't depend on other signatures, making signatures depend on each
other.  Why is this "flattening" necessary.

Actually, it's not so hard..  Signatures are just collections of
names, and don't contain any dependency information.  Actually,
dependencies are expressed _in terms of_ signatures.

The solution would be to define a new signature that has all the
identifiers the macros depend on, and have a dummy unit that
translates a bunch of signatures into the one needed by the macros.

Ok, I seem to be on the right way, but I at some point one of the
macros doesn't expand properly after generating an expression with
multiple invocations of another macro:  (begin (m ...) ...)

Nope... it expands just fine.  It's about one of the identifiers:
 "access from an uncertified context to unexported variable from
module: label:exit".  Binding it lexically before handing to the
"macro:" expander seems to make that error go away.

This lexical binding introduced another error: the `define' was no
longer top-level.