Feedback on Átila's Vision for D

Exil Exil at gmall.com
Mon Oct 21 17:39:48 UTC 2019


On Monday, 21 October 2019 at 13:44:16 UTC, Meta wrote:
> You're talking about the semantic appropriateness of A.foo 
> doing the same thing whether A is accessed through a reference 
> to a OneThing or an AnotherThing. I'm talking about whether it 
> is a bug or not, i.e., the correctness of the behaviour of the 
> implementation from a theoretical perspective.

No I'm not. Whether "foo" should do the same thing or not is 
irrelevant. I'm not talking about the semantics of it. I've used 
libraries where the same method name does different things. Under 
the right circumstances this is going to be true. Programming 
languages is a subset of written/spoken language, and English is 
full of ambiguities. With words having multiple meanings 
depending on what context they are used in.

> Compiler's don't examine your code for conformance to a given 
> set of semantics; that's up to humans. The best they can do is 
> check that your program is well-formed.

I'm talking about what is available to the user should they 
encounter this problem. There's no workaround to the problem, not 
an easy or clean one like one that can be easily implemented. 
Your arguing that no changes need to be made because Java does it 
that way. I don't agree with that at all, especially since it is 
Java. If that were the criteria for "correctness" we would not 
have operator overloading.






More information about the Digitalmars-d mailing list