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

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 14 11:22:40 PST 2016


What about simply this:


```
module foo;

{
import std.stdio;
void fun(File foo){}
}

{
import sd.range;
void foo(T) if(isInputRange!T){}
}

```



On Wed, Dec 14, 2016 at 9:50 AM, ketmar via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Wednesday, 14 December 2016 at 17:32:10 UTC, H. S. Teoh wrote:
>
>> What about:
>>
>>         /* Showing full declaration just for context */
>>         bool myFunc(R1, R2)(R1 r1, R2 r2)
>>         import {
>>                 std.range : isInputRange,
>>                 std.traits : isNum = isNumeric
>>         }
>>         if (isInputRange!R1 && isInputRange!R2 &&
>>             isNum!(ElementType!R1))
>>         in { assert(someCondition!R1); }
>>         out(result) { assert(result == expectedResult(...)); }
>>         body
>>         {
>>                 ...
>>         }
>>
>>
>> T
>>
>
> you won't stop me trying to write some code in import section then. hey,
> there are curly brackets, so it SHOULD accept code there! ;-)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20161214/6b7007c3/attachment-0001.html>


More information about the Digitalmars-d mailing list