New syntax within DWT / 2.

Matthew Ong ongbp at yahoo.com
Tue May 24 08:36:08 PDT 2011


On 5/24/2011 10:13 PM, Andrej Mitrovic wrote:
> It's not an unintended behavior of D, it's a fix for a problem that
> could be common in C++.

Thanks very much for any code shown.

Thanks for the clarification.
I was not aware of this URL.
http://d-programming-language.org/
I am aware of this URL.
http://www.digitalmars.com/d/2.0/hijack.html
...
and everything is hunky-dory. As before, things go on, AAA Corporation 
(who cannot know about B) extends A's functionality a bit by adding 
foo(int):
...
Now, consider if we're using Java-style overloading rules, where base 
class member functions overload right alongside derived class functions. 
Now, our application call:
...
b.foo(1);   // calls A.foo(int), AAAEEEEEIIIII!!!

Please let me know if that is not mis-leading way presenting if that is 
an intended feature.

Please remind yourself, if someone is new from Java and Java has no such 
problem because the virtual method invocation has works securely and 
stable for many many years in banks and other places. The problem that 
document shown:

As software becomes more complex, we become more reliant on module 
interfaces. (Java has absolutely no ambiguous and unstable confusion.)

So... Naturally I assume D is superior in desgin and does not has this 
issue.

-- 
Matthew Ong
email: ongbp at yahoo.com



More information about the Digitalmars-d-learn mailing list