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

Re: Hash::Util and read-only values

Thread Previous | Thread Next
Aristotle Pagaltzis
September 20, 2014 02:23
Re: Hash::Util and read-only values
Message ID:
Hi FC,

* Father Chrysostomos <> [2014-09-20 00:50]:
> Hash::Util::unlock_value should croak for any read-only (as opposed to
> locked) value.  But should Hash::Util::lock_value croak for those, or
> just return?  I am inclined to think it should croak, as a successful
> lock_value implies that later unlock_value will work.

to my mind, in unlocking a value there is no promise that the value will
be modifiable – it just reverts a previous locking, which in the case of
an immutable value is a noöp. So I will say the symmetry ought to go the
other way, i.e. locking and unlocking both should silently do nothing to
immutable values.

Aristotle Pagaltzis // <>

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