Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Perhaps someone could explain how it differs and compares to the friend keyword.


It 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..


Friend only allows others to access your private members. It doesn't allow you to define members in other classes though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: