develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [PATCH for discussion] new feature: clamp %hash

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
July 23, 2001 01:30
Subject:
Re: [PATCH for discussion] new feature: clamp %hash
Message ID:
20010723083026.1664.2@bactrian.ni-s.u-net.com
Jeffrey Friedl <jfriedl@yahoo.com> writes:
>|> Well, there are tradeoffs to his proposal, and they should at least be
>|> mentioned.....
>
>Sorry for the self-followup, but one overridingly important issue I forgot
>to mention is that the semantics of marking an HV "readonly" can be quite
>different than the marking of its individual values.
>
>After
>
>    my $ref = \$hash{SOMEKEY};
>    somehow_mark_readonly %hash;
>
>it is clear that
>	$hash{SOMEKEY} = 3;
>should not be allowed, but what about
>	$$ref = 3;
>?
>
>I can imagine convincing arguments for semantics that do and don't
>allow updates via the reference.

I can't. If the hash in readonly/clamped then it does not matter how 
you reach it it is readonly/clamped.

-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


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