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

arturg via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 14 15:46:55 PST 2016


On Wednesday, 14 December 2016 at 22:56:54 UTC, Andrei 
Alexandrescu wrote:
>
> The acceptability of the proposal decays exponentially with its 
> deviation from existing import syntax. -- Andrei

sorry, i missed the import keyword :/

T1 fun(T1, T2)(T1 t1, T2 t2)
import
{
      version(A)
      { import someMod: T1, T2; }
      else
      { import someOtherMod: T1, T2;}

      import std.stdio;

// this import block would support only import statemens, version 
and static if etc...

}
{
      t2.writeln;  // use symbols imported by the import block
      T1 ret = t1 + t2;
      return ret;
}


More information about the Digitalmars-d mailing list