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

Re: [Scheme-reports] Are generated toplevel definitions secret?

On Sun, Apr 24, 2011 at 03:39:37PM +0200, Andy Wingo wrote:
> How does this relate to modules and separate compilation?  I haven't
> figured out a good way to implement this yet.
> Guile does not currently introduce hygienic bindings for introduced
> toplevel identifiers, for this reason.  I think it's the same in
> Chicken's case, but they can tell you more about that.

Chicken uses an import library for that.  This library contains
information about a module's exported symbols and macros.
It also contains a mapping of bare identifiers to "internal" names.
These internal names are stable and comprise the actual "API" of
the imported library.  In Chicken's case, this mapping looks like
'((x . a#x) (y . a#y)) if the module name is a and it exports x and y.

When a module is imported somewhere, these mappings are added to the
syntactic environment so that it knows what to map them to.

I hope this sheds some light on how it works in Chicken.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

Scheme-reports mailing list