Flag proposal

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jun 10 19:16:34 PDT 2011


On 6/10/11 8:44 PM, Adam Ruppe wrote:
> Function local imports make it easier to reason about the code
> which is of slight importance. The big thing I'd like though is
> using it with mixins.
>
> In my cgi.d, there's a mixin main that depends on std.string being
> available inside the mixed in function.
>
> Currently, I use a public import of std.string. Alternatively, the
> other module could import it too, but that is pretty opaque.
>
>
> But a scoped import would be cleaner: I could ensure it's always
> available in that function without making the mixin user wonder
> WTF the error messages are about and without polluting his namespace.

Yes. Local imports facilitate local reasoning.

Andrei


More information about the Digitalmars-d mailing list