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

Re: Hash::Util and read-only values

Thread Previous | Thread Next
Reini Urban
September 21, 2014 04:42
Re: Hash::Util and read-only values
Message ID:
On Sat, Sep 20, 2014 at 11:59 AM, Father Chrysostomos <> wrote:
> 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;
> }

Why should this be a problem? When you convert this locked HE to a SV,
you mark the SV as READONLY.

>> There's enough room there, but there's no room in the SV,
> There is plenty of room in the SV.

There's none. There was one left free bit, which you just took without asking,
and there's nothing left now.
Your solution is a mess, even worse then the FAKE mess we had until we cleared
READONLY to get rid of FAKE.

>> and changing
>> the meaning of SvREADONLY again (with FAKE finally gone now)
>> is problematic.
> SvREADONLY still means read-only.

No, you are adding a HE-only bit to every single SV,
instead of adding of to the HE to mark locked hashes entries.
SvREADONLY_on is now setting the protect bit on every non-HV.
Locked strings? You got it. Locked integers? You got it now.

Please revert.

It's not as bad as your recent GV change, because this affected
everybody globally immediately, but it affects all my efforts to have
clean compile-time readonly-ness to be able to do
compile-time const optimizations and fast coretype checks, esp. typed
hashes, arrays and scalars.

Looks like I really have to fork this mess now to fix the worst parts
you were doing recently.
But I cannot because I have better things to do.
So I'll stop watching this mess now, goodbye 5.22 and p5p.
Please come to your senses somewhen in the next years.
The latest version I can recommend is 5.14.4 still.
Reini Urban

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About