localimport 1.3.0

Module for D's local import idiom.


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

localimport

D import idiom originally described by Daniel Nielsen, see this blog post. Later refined by Dgame, see here.

I basically moved this into a module and added some tests.

import localimport;

void main() {
    from.std.stdio.writeln("Hallo");
    auto _ = from.std.datetime.stopwatch.AutoStart.yes;
    std.stdio.writeln("Wow!");
    static assert(std.traits.isIntegral!byte);
    static assert(std.math.PI > 3.14);
    /*
    // this throws at compile time
    from.std.stdio.thisFunctionDoesNotExist("Hallo");
    from.std.stdio.thisFunctionDoesNotExist(42);
    */
}
Authors:
  • Daniel Nielsen
  • Dgame
  • FR86
Dependencies:
none
Versions:
1.3.0 2019-Jan-07
1.2.0 2019-Jan-07
1.1.0 2019-Jan-06
1.0.0 2019-Jan-06
~master 2019-Jan-07
Show all 5 versions
Download Stats:
  • 26 downloads today

  • 155 downloads this week

  • 868 downloads this month

  • 4121 downloads total

Score:
3.3
Short URL:
localimport.dub.pm