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

Re: Hash::Util and read-only values

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
September 20, 2014 02:23
Subject:
Re: Hash::Util and read-only values
Message ID:
20140920022346.GA74215@plasmasturm.org
Hi FC,

* Father Chrysostomos <sprout@cpan.org> [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.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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