develooper Front page | perl.perl5.porters | Postings from September 2014

Re: Hash::Util and read-only values

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
September 20, 2014 16:59
Subject:
Re: Hash::Util and read-only values
Message ID:
20140920165925.13239.qmail@lists-nntp.develooper.com
Reini Urban wrote:
> I don't like this. SvREADONLY should be the interface to
> readonly-ness, and not a combination thereof.
> 
> To lock hash keys and hash values you simply unify the Hash::Util lock
> keys and values API, and store the locked bit in the HE.

That cannot possibly protect the values.

for my $ro ($locked_hash{locked_elem}) {
  # $ro now points to just the SV, so a HE flag would not prevent:
  $ro = 42;
}

> There's enough room there, but there's no room in the SV,

There is plenty of room in the SV.

> and changing
> the meaning of SvREADONLY again (with FAKE finally gone now)
> is problematic.

SvREADONLY still means read-only.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About