3 ms·
I'm amazed nobody is talking about his 'private in' idea.
by akkartik 14y ago
I'm amazed nobody is talking about his 'private in' idea.
- tedunangst 14y agoPerhaps someone could explain how it differs and compares to the friend keyword.
- akkartik 14y agoIt has more to do with layout than with access control. Fields belonging to one class get stored and laid out with another object. They're accessed as part of the other object, but the locks they acquire are for the original object. I see faint echoes of ruby's open classes if I squint..
- rumcajz 14y agoFriend only allows others to access your private members. It doesn't allow you to define members in other classes though.
- scott_s 14y agoI did; we can achieve the same functionality through mixins: http://news.ycombinator.com/item?id=4455823 http://news.ycombinator.com/item?id=4455823