visibility vs. accessibility of protected symbols

Martin Nowak dawg at dawgfoto.de
Mon Feb 13 15:15:40 PST 2012


On Mon, 13 Feb 2012 19:07:20 +0100, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:

> On Sunday, February 12, 2012 19:32:28 David Nadlinger wrote:
>> On 2/12/12 7:28 PM, Martin Nowak wrote:
>> > The shallow distinction of visibility vs. accessibility breaks the
>> > module system because
>> > one can't safely add a private symbol without possibly affecting every
>> > dependent module.
>> > Thus we're back at using underscore names to protect from that.
>>
>> Yes, and this is exactly why I argued to disregard invisible symbols
>> during overload resolution in the past. Walter seems to be firmly
>> convinced that the current solution is the right thing to do, but I
>> can't recall what his reasons were.
>
> I'm not 100% sure that it's a good idea, depending on what the exact side
> effects are, but in principle, I'd love it if private symbols were  
> invisible to
> other modules.
>
> Now, this does _not_ fly with private being overridable, as TDPL claims  
> it
> should be. But I've already argued that that was a mistake due to the
> performance issues that it causes. I'm not sure what Walter's current  
> plans
> with that are though.
>
Can you elaborate on what issues you see with NVI. After all it's only the  
final public
method that needs to call the virtual private methods.


More information about the Digitalmars-d mailing list