Feedback on Átila's Vision for D
jared771 at gmail.com
Sun Oct 20 17:46:07 UTC 2019
On Sunday, 20 October 2019 at 17:34:17 UTC, Paulo Pinto wrote:
> On Sunday, 20 October 2019 at 17:11:27 UTC, Meta wrote:
>> On Sunday, 20 October 2019 at 09:31:34 UTC, Max Samukha wrote:
>> Interfaces in D do not have any state, i.e., they're not
>> allowed to declare member variables that implementing classes
>> inherit, and they don't define any implementation for
>> implementing classes to inherit - they just define the
>> interface (this has recently changed in Java now that
>> interfaces can define methods with a default implementation,
>> thus Java now provides a way to disambiguate if two different
>> interfaces declare default methods with the same name).
> They don't carry state, but they surely carry semantics hence
> why some languages allow to clarify the implementations.
> Because passing implementation B to a method expecting
> implementation A can lead to hard to track down errors.
I'm not saying that allowing to differentiate between
implementations would be worthless, just that it's not a bug that
D collapses them into 1 in the implementing class.
More information about the Digitalmars-d