A12 - Protected Attributes and Methods

2004-04-20 Thread Joe Gottman
   Apocalypse 12 was very clear about the difference between private and
public class members, but it didn't say anything about protected ones?  How
can you define a protected member?   Do you have to do the following?
has $.foo is protected;
method bar() is protected;

   Maybe we could have another secondary sigil to mark a protected method or
attribute.  I'd suggest the semicolon, but I'm afraid it would cause havoc
with the parser.

Joe Gottman




Re: A12 - Protected Attributes and Methods

2004-04-20 Thread Larry Wall
On Mon, Apr 19, 2004 at 08:21:58PM -0400, Joe Gottman wrote:
:Apocalypse 12 was very clear about the difference between private and
: public class members, but it didn't say anything about protected ones?  How
: can you define a protected member?

You can't.  The concept of protected does not exist in Perl 6.
A class is encapsulated even from its subclasses.

Larry