At Thu, 12 Oct 2017 12:59:17 -0700, Alexis King wrote: > An alternative approach that > I have considered (and discussed briefly with some people) is to > introduce a “value” scope using make-syntax-introducer in > #%module-begin, then use a separate “type” scope when parsing types to > keep the two bindings completely separate.
That sounds right to me. > Specifically, the main question occurs when considering code that spans > more than a single module. What do require and provide do? For the > provide case, it doesn’t seem too hard to have a (type-out ....) provide > transformer, but what happens when a user requires the module? Since my > understanding is that modules essentially only provide a set of > *symbols* per phase, not identifiers, would I need to mangle names in > order to allow a module to export a type with the same name as a value? > Would I need to write my own version of require to handle this without > wrapping all imports in a require transformer? What about interop with > other Racket languages? You could put all the type exports in a submodule. Then, you do need your own variant of `require`, but that variant can mostly just check for the presence of a type submodule, much the way that TR or `plai-typed` do. If the submodule is available, you can import it with the extra scope for types. -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

