CBFalconer wrote:
Waldek Hebisch wrote:
Frank Heckenbach wrote:
Waldek Hebisch wrote:
the in the case of overriding `b.dop' prints `b.p'. but in the case of shadowing it just prints `a.p', because `b.p' beeing a new method gets a new VMT slot, but `b.dop' calls old slot (so old method).
And Delphi does the latter? (Seems a bit contrary to the purpose of being virtual IMHO.)
Yes, Delphi uses shadowing. They have a rationale: they want to sove "fragile base class problem" (when change to base class propagates to the whole inheritance hierarchy). Most of the time you do not
I suspect you two have put much more time into thinking about Delphi and its consistencies and inconsistencies than ever did the Borland people. After all, it was thrown together for commerical purposes building on the non-compliant broken Turbo Pascal, using a transient set of programmers and architects, none of whom ever stayed very long, and none of whom had a real interest in the language.
Harsh words, but hoestly, I sometimes had this feeling when thinking about some strange BP constructs (e.g., `^' character constants). I can't imagine the Borland people really thought them through without ROTFL ...
Frank