Feedback on Átila's Vision for D
pjmlp at progtools.org
Sun Oct 20 17:34:17 UTC 2019
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.
More information about the Digitalmars-d