What are the unused but useful feature you know in D?

bauss jj_1337 at live.dk
Sat Nov 4 17:13:37 UTC 2017


On Saturday, 4 November 2017 at 13:27:29 UTC, rikki cattermole 
wrote:
> On 04/11/2017 2:14 PM, jmh530 wrote:
>> [...]
>
> Okay so:
>
> A signature when it is initiated is aware of the implementation 
> it is referencing. Allowing it to change how it behaves for 
> compatibility reasons.
>
> An interface is designed so that a class/interface must know of 
> the interface to inherit from.
>
> While signatures can and probably will inherit from others, 
> this is not how it is used unlike with interfaces. Because this 
> is a massive change in how we view them and their usage, 
> extending interfaces is not appropriate. Luckily an already 
> existing concept exists in the literature which does solve most 
> of the goals and that is signatures from the ML family.
>
> I will make a mental note to rewrite that section.

It reminds a lot of traits in Rust.

https://doc.rust-lang.org/1.8.0/book/traits.html


More information about the Digitalmars-d mailing list