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 "private" - subclasses > >> can't see it. > >> It's just Rakudo being leaky at the moment, not a fallacy of the Perl 6 > >> language. (Yes, we have failing tests for this; no, we don't run them at > >> the moment). > > > > That is indeed reassuring. Thank you. > > > > ...So, how come Perl 6 doesn't have a 'protected' access level? :)
In Perl 6, you can use private attributes in submethods, so protected is not so "badly" needed. > Exactly for the reasons you brought up against 'protected' as a default: > in encourages people to inherit from a class just to bypass some of the > public API. Apropos: I found the chapter about class declarator enlightening: http://www.dlugosz.com/Perl6/web/class-declarators.html (If some parts are not up-to-date, I would be happy to ear it.) > Cheers, > Moritz Ciao, Raphael.