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

If you want to maintain both syntaxes and have there be some sort of equivalence between them, then I think think the type system should handle it. Where a type operator ‘private-access’ grants access to some objects private fields and then obj.f() == f(private-access obj).

Maybe this would be seen as a violation of encapsulation, but to make the two equivalent requires the ability to allow private variable access at the call cite.



The point is that they’re not equivalent. What’s the difference between your proposal and just not having private members at all?




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

Search: