r-lib / R6

Encapsulated object-oriented programming for R
https://R6.r-lib.org
Other
407 stars 56 forks source link

Make private and public members and methods accessible internally using `self` prefix #84

Closed dataPulverizer closed 8 years ago

dataPulverizer commented 8 years ago

While writing methods internal to a class, it would be nice to be able to access private and public methods using the same prefix self, otherwise the programmer has to keep track of which members have been made private so that they can use the private prefix. When classes become large or classes are inherited in different places or indeed packages, it become impractical to constantly keep track of which members/methods are public and which are private.

Thanks

wch commented 8 years ago

Sorry, that's not possible because the self and private environments are different objects.