Yeah, it seems easy enough to do it in the compiler by grabbing the
defines internal to the module, and do either for all external modules
that are (#%provide (all-from ...))`:

1. If the module is a module path, calling `module->exports` on it.
2. Or if it's a submod in the current compilation unit, compile it
first and grab it's provides then.

I'm more then happy to do that myself. I just thought it was already
being done in the macro expander.

Thank you.

~Leif Andersen


On Thu, Feb 4, 2016 at 3:48 PM, Matthew Flatt <[email protected]> wrote:
> Phase-0 exports are available because those were the only kind of
> exports when syntax properties were originally added to a `module`
> expansion.
>
> I almost added information for other phases when I recently added the
> 'module-body-inside-context and 'module-direct-for-meta-requires
> properties. In the end, I skipped that addition; unlike the other
> information, it seemed relatively easy enough to reconstruct exports
> from a module's expansion.
>
> So, I can fill out provided-identifier information if it seems
> important, but it's somewhat tedious to add, and I'd prefer to leave it
> out.
>
> At Thu, 4 Feb 2016 15:24:22 -0500, Leif Andersen wrote:
>> A module's syntax properties when fully expanded do a reasonable job
>> getting the requires and provides out. However, if I have something
>> defined (and provided) in a phase other than 0, it seems to be
>> missing. For example:
>>
>> #lang racket
>>
>> (require zordoz)
>>
>> (define mod
>>   #'(module foo racket/base
>>       (#%plain-module-begin
>>        (#%require (only racket/match match))
>>        (#%provide x)
>>        (#%provide (for-syntax y))
>>        (define x 5)
>>        (define-for-syntax y 6))))
>>
>> (expand mod)
>>
>> In the expanded module there is no syntax property for `y`, even
>> though it's provided for syntax.
>>
>> Now, I could (and currently do) just recalculate this when I'm
>> compiling the module, but this seems a little bit silly to redo as the
>> macro expander seems to already have this information.
>>
>> Is it possible to have all of a module's provides included when a
>> syntax object is expanded, and not just it's phase level 0 ones, or am
>> I missing something?
>>
>> Thank you.
>>
>> ~Leif Andersen

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CAAVaeECAmyyOiFqjdAz7gLi%2BJcCE5%2B6FQKeKWK3w6ynyS%2BREUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to