Only want to say

Ali Çehreli acehreli at yahoo.com
Wed Jan 13 16:58:31 UTC 2021


On 1/12/21 2:46 PM, ddcovery wrote:

 > The only small problem I found is you can not import exclusive contract
 > dependencies (because you have not a block)... but this is not a real
 > problem.

A reminder of the self-important[1] D idiom.

auto foo(string s)
in (from!"std.uni".isUpper(from!"std.range".front(s))) {
   return s;
}

void main() {
   foo("Hello");
}

template from(string moduleName)
{
   mixin("import from = " ~ moduleName ~ ";");
}

Ali

[1] https://dlang.org/blog/2017/02/13/a-new-import-idiom/



More information about the Digitalmars-d mailing list