DIP22 : Private symbol visibility

Jesse Phillips Jessekphillips+D at gmail.com
Thu Jan 31 12:43:13 PST 2013


On Wednesday, 30 January 2013 at 09:42:01 UTC, Dicebot wrote:
> On Wednesday, 30 January 2013 at 05:29:14 UTC, Jesse Phillips 
> wrote:
>> And this results in people writing code that ...? Is there an 
>> example where you can break code in another module by changing 
>> something marked as private?
>
> Examples separated:
> http://forum.dlang.org/post/irrbdrxordjawkryvrub@forum.dlang.org

I meant more that these questions should be answered the DIP page.

>> "Compiler errors upon access to private symbol are changed 
>> from "%s is not accessible" to "undefined identifier %s""
>>
>> That will just be confusing. You put the name of that symbol 
>> because you saw it, being told it is undefined is going to 
>> make you think the compiler is broken.

> Also in case of denied access most likely you have put that 
> symbol because of typo, not because you know it (why would you 
> intentionally try to use symbol you already know is private?). 
> And it exposes internal module details by an accident.

My assumption is that I don't know why you put that symbol there. 
Did you know it was private? Did you intent to make it public? 
Did you forget what you were doing and entered a random word, 
were told it was undefined, looked up the source and complained 
that you could see it?

How you found that the symbol is defined isn't a concern to me, 
it is the fact that you can verify and be confused that the 
compiler doesn't see it.


More information about the Digitalmars-d-announce mailing list