Re: You never have privacy from your children in Perl 6

2010-03-29 Thread Martin D Kealey
On Mar 27, 2010, at 15:43 , Darren Duncan wrote: For example, say you want to define a graph of some kind, and for elegance you have a separate container and node and side classes, On Sat, 27 Mar 2010, Brandon S. Allbery KF8NH wrote: This sounds like a hackaround for an incomplete

Re: You never have privacy from your children in Perl 6

2010-03-29 Thread Darren Duncan
Martin D Kealey wrote: On Mar 27, 2010, at 15:43 , Darren Duncan wrote: For example, say you want to define a graph of some kind, and for elegance you have a separate container and node and side classes, On Sat, 27 Mar 2010, Brandon S. Allbery KF8NH wrote: This sounds like a hackaround for

Re: You never have privacy from your children in Perl 6

2010-03-27 Thread Sean Hunt
On 03/26/2010 04:16 PM, Jason Switzer wrote: 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

Re: You never have privacy from your children in Perl 6

2010-03-27 Thread Darren Duncan
My own take on 'trusts' is that I consider its main purpose is to let programmers *avoid* contrivances when they want to define something that would otherwise be a single class but is split into multiple classes for better elegance. For example, say you want to define a graph of some kind, and

Re: You never have privacy from your children in Perl 6

2010-03-27 Thread Brandon S. Allbery KF8NH
On Mar 27, 2010, at 15:43 , Darren Duncan wrote: My own take on 'trusts' is that I consider its main purpose is to let programmers *avoid* contrivances when they want to define something that would otherwise be a single class but is split into multiple classes for better elegance. For

Re: You never have privacy from your children in Perl 6

2010-03-26 Thread Carl Mäsak
Carl (), Darren (): I didn't get it to trust me, though: masak pugs: class A { has $!foo }; class B { trusts A; method bar(A $a) { say $a!foo } }; B.new.bar(A.new(:bar(42))) p6eval pugs: OUTPUT«␤» Either it bitrotted or I'm using it wrong. You're using it wrong.  You need to put 'trusts

Re: You never have privacy from your children in Perl 6

2010-03-26 Thread Jason Switzer
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

Re: You never have privacy from your children in Perl 6

2010-03-25 Thread Carl Mäsak
Carl (), Moritz (), Carl (), Moritz (): masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. That's wrong. Perl 6's private is like Java's private - subclasses can't see it. It's just Rakudo being leaky at the

Re: You never have privacy from your children in Perl 6

2010-03-25 Thread Darren Duncan
Carl Mäsak wrote: Carl (), Moritz (), Carl (), Moritz (): masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. That's wrong. Perl 6's private is like Java's private - subclasses can't see it. It's just Rakudo being

Re: You never have privacy from your children in Perl 6

2010-03-25 Thread Carl Mäsak
Carl (), Darren (): [...] and the 'trusts' keyword hasn't been realized in any Perl 6 implementation so far. I seem to recall that Pugs did support 'trusts' a few years ago, and that I used it.  But I could be wrong. -- Darren Duncan I stand corrected. A quick search through the Pugs

Re: You never have privacy from your children in Perl 6

2010-03-25 Thread Darren Duncan
Carl Mäsak wrote: Carl (), Darren (): [...] and the 'trusts' keyword hasn't been realized in any Perl 6 implementation so far. I seem to recall that Pugs did support 'trusts' a few years ago, and that I used it. But I could be wrong. -- Darren Duncan I stand corrected. A quick search

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Moritz Lenz
Carl Mäsak wrote: masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. That's wrong. Perl 6's private is like Java's private - subclasses can't see it. It's just Rakudo being leaky at the moment, not a fallacy of

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Carl Mäsak
Carl (), Moritz (): masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. That's wrong. Perl 6's private is like Java's private - subclasses can't see it. It's just Rakudo being leaky at the moment, not a

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Moritz Lenz
Carl Mäsak wrote: Carl (), Moritz (): masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. That's wrong. Perl 6's private is like Java's private - subclasses can't see it. It's just Rakudo being leaky at

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Daniel Ruoso
Em Ter, 2010-03-23 às 19:41 +0100, Carl Mäsak escreveu: masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. jonalv what? so there's only really 'public' and 'protected', but no 'private'? masak basically, yes.

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Moritz Lenz
Daniel Ruoso wrote: Em Ter, 2010-03-23 às 19:41 +0100, Carl Mäsak escreveu: masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. jonalv what? so there's only really 'public' and 'protected', but no 'private'?

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Daniel Ruoso
Em Ter, 2010-03-23 às 20:53 +0100, Moritz Lenz escreveu: unless you count 'trusts' traits, which are specific to single classes, not groups of subclasses Yes, that was what I meant... daniel

Re: You never have privacy from your children in Perl 6

2010-03-23 Thread Raphael Descamps
Am Dienstag, den 23.03.2010, 20:06 +0100 schrieb Moritz Lenz: Carl Mäsak wrote: Carl (), Moritz (): masak um, so 'protected' is when the deriving classes can see the attribute? jonalv yup masak that's what 'private' means in Perl 6. That's wrong. Perl 6's private is like Java's