The year is 2019

aliak something at something.com
Sat Jul 27 10:46:10 UTC 2019


On Saturday, 27 July 2019 at 09:38:20 UTC, Mike Franklin wrote:
> On Saturday, 27 July 2019 at 05:09:11 UTC, XavierAP wrote:
>
>> I was thinking of something simpler. And also new to the 
>> language, not that could or should be implemented by lowering 
>> (specially not lowering to alias this).
>>
>> Again leaving multiple aside:
>>
>>     interface IPrintable
>>     {
>>         string toString();
>>     }
>
> I like the idea of using interfaces, but I'm not sure how to 
> implement such a thing for structs.  Is it just a compile-time 
> contract?  How does it work at runtime when we call a function 
> like `void foo(IPrintable p);` with an instance of `XY` or 
> `ParallelXY`?


You reminded me of the existence of this:

https://github.com/rikkimax/DIPs/blob/master/DIPs/DIP1xxx-RC.md



More information about the Digitalmars-d mailing list