develooper Front page | perl.perl5.porters | Postings from February 2017

Re: Should we consider locked hashes a failed experiment?

Thread Previous | Thread Next
From:
Tim Bunce
Date:
February 1, 2017 21:00
Subject:
Re: Should we consider locked hashes a failed experiment?
Message ID:
20170201210030.GS1455@timac.local
I've frequently used locking hash keys, and sometimes also hash values,
as an effective defensive measure in $work code.

(I've also used the Locked type constraint in Types::ReadOnly, which does
the same thing with more sugar.)

I'm a little surprised by the apparent willingness to break such code.

I'd be very happy to see something like a vtable implementation for
hashes that would allow features like locking to be removed from the core.

Meanwhile, for those keen to squeeze the last ounce of performance,
perhaps locking could be disabled via build option in the same way that
tainting can be disabled.

Tim.

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