On 01/03/2017 02:19 AM, Dominikus Dittes Scherkl wrote:
On Monday, 2 January 2017 at 21:23:19 UTC, Andrei Alexandrescu wrote:
DIP1005 gives consideration to the speed of compilation aspect in
larger proportion than speed's importance; the first and foremost
benefit of DIP1005 is it closes the gap on dependency encapsulation,
which had been very successfully narrowed by local imports.
I love that idea. But I still can't see why this requires any new
syntax. Simply extending the scope of local inports to include the
function header is enough.

I'll mention this possibility in the DIP.

Only for .di-generation it may be useful to move all local imports to
the declaration (maybe with this new syntax "with" before it) - but that
should be done with ALL local imports, because today the .di-files are
incomplete and will stay so if the new syntax is introduced but
"old-style" local imports still valid and not exported to the .di.
Or the old local imports become deprecated together with the
introduction of the new "with" syntax and vanish soon after that.

Local imports don't pertain to the interface, they are an implementation detail. Why would those be made a part of the .di?


Andrei

Reply via email to