On Fri, Mar 26, 2010 at 7:16 AM, Carl Mäsak <cma...@gmail.com> wrote:
> You're using it wrong. You need to put 'trusts B;' in A in order for B to > > see A's privates. I hope it is obvious why this is the case. -- Darren > > Duncan > > Aye, my mistake. Apparently the syntax I used to try to get at the > private attribute would instead have called a private method. So much > for rooting things in the concreteness of an implementation. ;) I'm assuming Moritz is right in that Rakudo is currently leaky with private members (such as $!b in Masak's example), and I agree that truly private members has great value. It was unclear to me from the discussion so far whether this is the case for Perl 6. Also, this discussion of "trusts" piqued my interest; this sounds like a bad idea. Those of you who have worked extensively with C++ should bemoan "trusts" as much as friend classes. They break encapsulation for special cases, almost encouraging truly hideous object models that ultimately become purely public (painful on a large scale). I can't stress enough that if these are of similar nature, "trusts" should be removed. I'm all ears though if someone knows of a reason why they're more useful than onerous. -Jason "s1n" Switzer