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

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

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 Ckeys) 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 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 Cexists nodes in the op

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 new

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 Ckeys) 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-05 Thread Tom Christiansen
exists (sometimes causes autovivification, which affects Ckeys) 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-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 instant vote! And

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 = "demo", _rank =

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 Iindirectly 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-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
Once a hash has been Cprivate-ized, the only way to extend its set of entries is via another call to Cprivate: sub new { my ($class, %self) = @_; bless private \%self, $class; private $self{seed} = rand; # okay