DIP22 : Private symbol visibility

Dicebot m.strashun at gmail.com
Fri Feb 1 01:34:17 PST 2013


On Wednesday, 30 January 2013 at 11:39:26 UTC, Timon Gehr wrote:
> On 01/30/2013 10:42 AM, Dicebot wrote:
>> ...
>> That was the most uneasy part of proposal. I have been 
>> thinking for few
>> hours about it, considering different options. In the end, I 
>> have
>> decided that it is only confusing to one coming from C++ lax 
>> approach
>> and for clean mind it should make perfect sense that private 
>> symbol is
>> indistinguishable from non-existing one in regular user code - 
>> that is
>> the point of encapsulation how I get it.
>> ...
>
> As long as compile-time reflection cannot get hold of the error 
> message, the more helpful diagnostic does not do any harm. 
> (After all, the programmer might still be aware of the 
> existence of the member, but missing that it is not accessible 
> (yet) from the module he/she is currently working on.)

I am arguing exactly that it is more helpful as it somewhat 
breaks encapsulation. I really believe it is good to not give out 
information that was no supposed to be shown. What do you think 
about changing both undefined and denied access messages to one 
"symbol is undefined or inaccessible" then?


More information about the Digitalmars-d-announce mailing list