DIP10005: Dependency-Carrying Declarations is now available for community feedback

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 3 01:02:37 PST 2017


On Tue, 03 Jan 2017 07:19:41 +0000, 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.

You mean:

  Socket connect()
  {
    import std.socket;
    return new Socket();
  }

Which should already work if you used auto for the return type.


More information about the Digitalmars-d mailing list