Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-17 Thread Damian Conway
> This is an interesting proposal, but it seems to be missing > something, or maybe I am. It seems like once a single hash entry is > marked private, that it is then impossible to mark future entries > non-private...i.e. there is no corresponding unary "public" > function. That's r

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-16 Thread Glenn Linderman
Perl6 RFC Librarian wrote: > The effects of applying C to a single hash entry would be to: > > =over 4 > > =item 1. > > mark the entire hash as non-autovivifying (except via future calls to > C -- see below) This is an interesting proposal, but it seems to be missing something, or maybe I am. I

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Damian Conway
> >In fact, I shall extend RFC 128 to allow subroutine parameter to specify > >that they are non-autovivifying. > > I'm not sure why it matters to the subroutine. We've already got > the hack so that > > fn( $a[$i] ) > or > fn( $h{$k} ) > > will onl

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Tom Christiansen
>I agree entirely. >In fact, I shall extend RFC 128 to allow subroutine parameter to specify >that they are non-autovivifying. I'm not sure why it matters to the subroutine. We've already got the hack so that fn( $a[$i] ) or fn( $h{$k} ) will only autoviv those puppies if you muddle

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Damian Conway
> >That seems reasonable--except that I don't believe exists() merits > >any special treatment. > > More specifically, I think all non-lvalue context use of -> should be > non-autoviv, whether exists or anything else. I agree entirely. In fact, I shall extend RFC 128 to allow

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Tom Christiansen
>That seems reasonable--except that I don't believe exists() merits >any special treatment. More specifically, I think all non-lvalue context use of -> should be non-autoviv, whether exists or anything else. --tom

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Tom Christiansen
>That's not required. All that is necessary is for C nodes >in the op tree to propagate a special non-autovivifying context to >subordinate nodes. That seems reasonable--except that I don't believe exists() merits any special treatment. --tom

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Damian Conway
> Why can't we just apply the same warnings on hashes as we do on > variables in Perl? Maybe a new lexical pragma: > > no autoviv; # any autovivification carps (not just > # hashes) > > no autoviv 'HASH'; # no

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Damian Conway
> > print keys %hash, "\n"; > > exists $hash{key}{subkey}; > > print keys %hash, "\n"; > > >Or did that get fixed when I wasn't looking? > > No, the -> operator has not been changed to do lazy evaluation. That's not required. All that is necessary is for C nodes in the o

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Bart Lateur
On Tue, 05 Sep 2000 19:08:18 -0600, Tom Christiansen wrote: >> exists (sometimes causes autovivification, which affects C) > >That's not technically accurate--exists never causes autovivification. print exists $hash{foo}{bar}{baz}; use Data::Dumper; print Dumper \

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Tom Christiansen
>On Tue, 05 Sep 2000 19:08:18 -0600, Tom Christiansen wrote: >>> exists (sometimes causes autovivification, which affects C) >> >>That's not technically accurate--exists never causes autovivification. > print exists $hash{foo}{bar}{baz}; > use Data::Dumper; > print Dumpe

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-06 Thread Jonathan Scott Duff
On Wed, Sep 06, 2000 at 12:05:21PM +1100, Damian Conway wrote: >> This bothers me. Name an operation in perl that, when applied to >> a single element of an aggregate, affects all other elements of >> the aggregate (especially future, as-yet-unborn elements). > > There are remarkably

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-05 Thread Tom Christiansen
> > > exists (sometimes causes autovivification, which affects C) > > > > That's not technically accurate--exists never causes autovivification. > print keys %hash, "\n"; > exists $hash{key}{subkey}; > print keys %hash, "\n"; >Or did that get fixed when I wasn't looki

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-05 Thread Damian Conway
> > exists (sometimes causes autovivification, which affects C) > > That's not technically accurate--exists never causes autovivification. print keys %hash, "\n"; exists $hash{key}{subkey}; print keys %hash, "\n"; Or did that get fixed when I wasn't looking

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-05 Thread Tom Christiansen
> exists (sometimes causes autovivification, which affects C) That's not technically accurate--exists never causes autovivification. --tom

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-05 Thread Damian Conway
> > mark the entire hash as non-autovivifying (except via future calls to > > C -- see below) > > This bothers me. Name an operation in perl that, when applied to a single > element of an aggregate, affects all other elements of the aggregate > (especially future, as-yet-unborn

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-05 Thread Jonathan Scott Duff
On Fri, Sep 01, 2000 at 08:59:10PM -, Perl6 RFC Librarian wrote: > =head1 TITLE > > Objects : Private keys and methods > =head1 ABSTRACT > > This RFC proposes a new keyword -- C -- that limits the > accessibility of keys in a hash, and of methods. Its primary use would be to > provide encap

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-04 Thread Dave Rolsky
On 1 Sep 2000, Perl6 RFC Librarian wrote: > Private entries of hashes could be I accessed in packages > that inherit from the entry's package, by qualifying (i.e. prefixing) the > key with the entry's package name. For example: > > package Base; > > sub new { >

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-04 Thread Damian Conway
> Will "private" be a true scoping keyword? Or under strict would you have > to do this: > >private my %hash; It's not a replacement for C, though C *might* choose to overlook it. :-) Damian

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-04 Thread Nathan Wiger
> private $hash{key}; > private $hash{$key}; > private $hashref->{key}; > > or to a hash slice: > > private @hash{qw(_name _rank _snum)}; > > or to a complete hash (either directly, or via a reference): > > private %hash; > private { _name => "de

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-04 Thread Piers Cawley
John Siracusa <[EMAIL PROTECTED]> writes: > On 9/1/00 4:59 PM, Perl6 RFC Librarian wrote: > > Once a hash has been C-ized, the only way to extend its set of > > entries is via another call to C: > > > > sub new { > > my ($class, %self) = @_; > > bless private \%self, $class; > >

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-04 Thread Piers Cawley
"David E. Wheeler" <[EMAIL PROTECTED]> writes: > On 1 Sep 2000, Perl6 RFC Librarian wrote: > > > This and other RFCs are available on the web at > > http://dev.perl.org/rfc/ > > > > =head1 TITLE > > > > Objects : Private keys and methods > > Here, here & amen, Damian! This one gets my insta

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-02 Thread David E. Wheeler
On 1 Sep 2000, Perl6 RFC Librarian wrote: > This and other RFCs are available on the web at > http://dev.perl.org/rfc/ > > =head1 TITLE > > Objects : Private keys and methods Here, here & amen, Damian! This one gets my instant vote! David

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-02 Thread Damian Conway
> > private $self->{data} = $derdata; > > should be $derdatum here? Yes. Thanks. Damian

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread Kenneth Lee
Kenneth Lee wrote: > > > Once a hash has been C-ized, the only way to extend its set of > > entries is via another call to C: > > > > sub new { > > my ($class, %self) = @_; > > bless private \%self, $class; > > private $self{seed} = rand;

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread Kenneth Lee
> Once a hash has been C-ized, the only way to extend its set of > entries is via another call to C: > > sub new { > my ($class, %self) = @_; > bless private \%self, $class; > private $self{seed} = rand; # okay > $self{se

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread Kenneth Lee
> package Derived; > use base 'Base'; > > sub new { > my ($class, $derdatum, @basedata) = @_; > my $self = $class->SUPER::new(@basedata); > private $self->{data} = $derdata;

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread John Siracusa
On 9/1/00 4:59 PM, Perl6 RFC Librarian wrote: > Once a hash has been C-ized, the only way to extend its set of > entries is via another call to C: > > sub new { > my ($class, %self) = @_; > bless private \%self, $class; > private $self{seed} = rand; # okay > $s

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread Damian Conway
00 21:15:31 + > Received: (qmail 28917 invoked from network); Fri, 01 Sep 2000 21:15:30 + > 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: Messa

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread Tom Christiansen
>=head1 REFERENCES >Christiansen & Torkington, I, pp. 470-472. >Conway, I, pp. 309-326. One might add refs to Camel-3's new OO chapter on privacy approaches. --tom

Re: RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread Tom Christiansen
>=head2 Private methods >The C 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 { ... } >

RFC 188 (v1) Objects : Private keys and methods

2000-09-01 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Objects : Private keys and methods =head1 VERSION Maintainer: Damian Conway <[EMAIL PROTECTED]> Date: 1 September 2000 Mailing List: [EMAIL PROTECTED] Version: 1 Number: 188 Status: Developing