At Sun, 18 Jun 2017 06:47:24 -0400, Tony Garnock-Jones wrote: > First, it seems like since the whole point of require is to pollute the > surrounding namespace, an "unhygienic" require would be better.
Generally, I don't see the difference between `require` and `define` in terms of the intent to bind identifiers. Many parts of Racket rely on `require` binding being hygienic in the same way as definitions. But... > My past experiences of this kind of problem have all been related to > #lang and module and require-level binding, come to think of it. It > seems a murky area. Perhaps other kinds of hygiene-preserving techniques > than those that work well for expressions are needed for these areas? ... I agree that hygiene is not always a convenient default for module languages, which frequently want to introduce non-hygienic bindings. I don't know how to make this better, but it's something to think about. Also, the way that `require` forms synthesize binding names is non-hygienic in a sense or at some level, which is probably what you're getting at initially. > And second, I'm used to macros hinging on the binding of the identifier > in their car, namely `submod` here. That would be worse, because `submod` itself is bound (as a `require` form), and you might want to introduce a binding using `submod` in a context that doesn't have a binding for `submod` itself. Most binding-synthesizing macros in Racket work that way (or should) --- using the context of the parentheses for introducing bindings, instead of the context of the identifier. Non-hygienic macros don't compose well, but that distinction makes them usefully more composable. In the case of `submod`, the context of the submodule name would work just as well as the context of the parentheses, and would have been more convenient for your use, but it's less convenient in some other uses. > PS. Why do *parentheses* have a binding context, anyway?? Mostly for `#%app`, but it's also a handy as a general convention for distinguishing binding context from use context. -- 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.

