Re: RFC 188 (v1) Objects : Private keys and methods
[email protected] (Damian Conway)
| Newsgroups | perl.perl6.language.objects |
|---|---|
| Message-ID | <[email protected]> |
> From perl6-language-objects-return-221-damian=indy05.csse.monash.edu.au@perl.org Sat Sep 2 08:16:14 2000 > Received: from ALPHA1.CC.MONASH.EDU.AU (alpha1.cc.monash.edu.au [130.194.1.1]) > by indy05.csse.monash.edu.au (8.8.8/8.8.8) with ESMTP id IAA21970 > for <[email protected]>; Sat, 2 Sep 2000 08:16:14 +1100 (EST) > Received: from tmtowtdi.perl.org ([209.85.3.25]) > by vaxc.cc.monash.edu.au (PMDF V6.0-24 #43886) > with SMTP id <[email protected]> for > [email protected]; Sat, 02 Sep 2000 08:15:57 +1100 > Received: (qmail 28934 invoked by uid 508); Fri, 01 Sep 2000 21:15:31 +0000 > Received: (qmail 28917 invoked from network); Fri, 01 Sep 2000 21:15:30 +0000 > Date: Fri, 01 Sep 2000 15:15:26 -0600 > From: Tom Christiansen <[email protected]> > Subject: Re: RFC 188 (v1) Objects : Private keys and methods > In-reply-to: Message from Perl6 RFC Librarian <[email protected]> > "of 01 Sep 2000 20:59:10 -0000." <[email protected]> > To: [email protected] > Cc: [email protected] > Message-id: <19984.967842926@chthon> > Content-transfer-encoding: 7BIT > Precedence: bulk > Delivered-to: mailing list [email protected] > Mailing-List: contact [email protected]; run by ezmlm > List-Post: <mailto:[email protected]> > List-Subscribe: <mailto:[email protected]> > List-Unsubscribe: <mailto:[email protected]> > List-Help: <mailto:[email protected]> > Status: O > > >=head2 Private methods > > >The C<private> keyword could also be applied to subroutines, to restrict > >where they may be called. Access rules similar to those for private hash > >entries would apply: > > > package Base; > > sub new { ... } > > private sub check { ... } > > How is this different/better/worse from "my sub"? It complements it. Private methods aren't lexically scoped. They can be called (through a qualified name) anywhere in the inheritance tree of the "owner" class. Damian