Feedback on Átila's Vision for D
Exil at gmall.com
Sun Oct 20 20:41:01 UTC 2019
On Sunday, 20 October 2019 at 17:46:07 UTC, Meta wrote:
> 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.
Sure, one can argue that it's not a bug, auto-decoding isn't a
bug, in fact it was very much intentional. But I think we'd all
be better off without it. The way it is implemented can lead to
bugs quite easily. Since it picks whichever one based on order.
None of this is obvious. Rationale like your's is why the bug
reports like this one remain open for 9+ years and it never gets
fixed. It's not a bug it's a feature! Therefore any change is an
enhancement and requires a DIP.
More information about the Digitalmars-d