Closed agstudy closed 9 years ago
No, sorry. Private members can only be accessed within the class or a subclass.
Don't want to reopen this necessarily, but I was wondering if there is a recommended practice for these use cases:
I think it's a feature of R6 to seriously enforce information hiding. Not asking to weaken this guarantee. I just would like to compare notes with other people facing these problems. C++ for instance has the notion of friend functions and classes to selectively bypass information hiding. What should we do in R6?
For the first, I don't know of a good solution offhand. For the second, I've been considering adding static (or class) methods: #66.
Got it, thanks. I think you are on the right track by making private members really, strongly private, not wishy washy private.
Within R6 class, is there any possibility to access a private member outside the class or at least from another R6 class?