This is a cool demo! Unfortunately, I have been thinking about the problem you describe since last night, and I am still totally stumped. This is something that seems difficult or impossible to paper over with more macros because #%require and #%provide are, ultimately, given special treatment by the macroexpander (at least that is my understanding), and the `expand` subform of #%provide is not something that can be emulated as a derived concept.
At this point, though it is indisputably evil, it seems more feasible to use some name mangling scheme than to expand to a submodule. That would be, of course, deeply unsatisfying, so I would very much like to have a better solution. > On Oct 12, 2017, at 6:07 PM, Alex Knauth <alexan...@knauth.org> wrote: > > I just implemented this, and this is a problem, but the `all-from-out` > form in general is an ever bigger problem, it's completely broken. > > The first strategy is to just lift the provide form into a submodule, > but `all-from-out` expects there to be a require in the *same* module, > `all-from-out` always yells at you with the error, all-from-out: no > corresponding require. > > The second strategy is to try to resolve the `all-from-out` references > in the pre-transformer using `expand-export`. However this is still > broken for `all-from-out` because > `syntax-local-module-required-identifiers` complains about "not > currently transforming module provides." > (syntax-local-transforming-module-provides? is false). All-from-out > uses syntax-local-module-required-identifiers to determine what > identifiers should be in it, and that needs to be called within a > provide-transformer, not a provide pre-transformer. > > To create a new lifted module I need to use a provide-pre-transformer, > but to resolve all-from-out's properly I need to use a > provide-transformer. Is there any way around this? > > What I have so far: > https://gist.github.com/AlexKnauth/b7d9f2e0af1c5b8e2186d6581b1f7e4d > > Alex Knauth -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.