[racket-dev] processing the internal-context of a mod?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Thu Apr 25 18:35:40 EDT 2013

> I'm trying to understand the case analysis so that I can properly
> generate the code to construct the namespace.  The documentation says
> I have four things to keep track of for internal-context:
>
>     case 1: #f: it's empty
>     case 2: #t: it's all the requires
>     case 3: stx: it's the lexical context of the wrapped syntax object
>     case 4: (vectorof stx): ???
>
> Case 2 seems fairly straightforward to me: to construct the namespace
> for a module, I take all the symbols defined in its prefix, and
> combine that with all the exports of all the required modules.

Followup:

I have yet to synthesize a case other than case 2 or 3, so I have to
admit I still don't understand.

In my own experiments, if the internal context is a syntax object,
then it's an object whose datum is #f, and whose wraps consist only of
module-rename wraps.  Am I guaranteed that the syntax objects
associated to the module's internal context only consist of
module-rename wraps?

Posted on the dev mailing list.