On Wednesday, June 12, 2013 13:26:44 Daniel Murphy wrote: > "Jonathan M Davis" <[email protected]> wrote in message > news:[email protected]... > > > On Wednesday, June 05, 2013 22:50:14 Michel Fortin wrote: > >> P.S.: while implementing this change, please make sure private and > >> package functions can be virtual. > > > > I'd agree with package on that, but I don't think that private should be > > virtualizable, because that conflicts with actually hiding non-accessible > > functions, which is what a number of us are pushing for. Otherwise, > > private > > implementation details of classes and modules risk causing code breakage > > (e.g. > > the fact that overload resolution occurs before checking the access level > > is > > atrocious). > > > > - Jonathan M Davis > > Private functions can be overridden only within the same module. This does > not conflict with hiding private members from _outside_ the module. You > will always be able to _see_ private members from inside the same module, > virtual or not.
Good point, but I fully expect that many of the folks who want to do NVI will want to use private functions for that as they do in C++, and I think that that would be a mistake. private is accessible within a module, so it should be visible to everything in that module, but IMHO, it shouldn't be visible or overridable outside of the module, as nothing outside of the module would have access to it, and it would be too detrimental with regards to name clashes to permit it. - Jonathan M Davis
