Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
March 13, 2007 d- encapsulation | ||||
---|---|---|---|---|
| ||||
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 Re: d- encapsulation | ||||
---|---|---|---|---|
| ||||
Posted in reply to arun s | 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 Re: d- encapsulation | ||||
---|---|---|---|---|
| ||||
Posted in reply to arun s | 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 Re: d- encapsulation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomas Lindquist Olsen | 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 Re: d- encapsulation | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kyle Furlong | 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
|
Copyright © 1999-2021 by the D Language Foundation