Thread overview
d- encapsulation
Mar 13, 2007
arun s
Mar 13, 2007
BCS
Mar 13, 2007
Kyle Furlong
Mar 14, 2007
janderson
March 13, 2007
i want to know how the encapsulation rules works in D.
i have made a attribute as private in the class, but am able to access this attribute directly from the class instance...can any body give reason for this???

March 13, 2007
Reply to arun,

> i want to know how the encapsulation rules works in D.
> 
> i have made a attribute as private in the class, but am able to access
> this attribute directly from the class instance...can any body give
> reason for this???
> 

If the two classes are in the same file this will happen (private only limits access to the module). If they are in different modules than this would be a bug, however IIRC there are a few bugs of this type around.


March 13, 2007
arun s wrote:

> i want to know how the encapsulation rules works in D.
> i have made a attribute as private in the class, but am able to access
> this attribute directly from the class instance...can any body give reason
> for this???

You should post some code for decent replies.
March 13, 2007
Tomas Lindquist Olsen wrote:
> arun s wrote:
> 
>> i want to know how the encapsulation rules works in D.
>> i have made a attribute as private in the class, but am able to access
>> this attribute directly from the class instance...can any body give reason
>> for this???
> 
> You should post some code for decent replies.

Formatting, punctuation, capitalization, spelling, and grammar would all  go a long way toward getting decent replies as well.
March 14, 2007
Kyle Furlong wrote:
> Tomas Lindquist Olsen wrote:
>> arun s wrote:
>>
>>> i want to know how the encapsulation rules works in D.
>>> i have made a attribute as private in the class, but am able to access
>>> this attribute directly from the class instance...can any body give reason
>>> for this???
>>
>> You should post some code for decent replies.
> 
> Formatting, punctuation, capitalization, spelling, and grammar would all  go a long way toward getting decent replies as well.

Really?  Then I feel sorry for people who's primary language is not English.

-Joel