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

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

Thread Previous | Thread Next
Nick Ing-Simmons
July 20, 2001 01:11
Re: [PATCH for discussion] new feature: clamp %hash
Message ID:
Jeffrey Friedl <> writes:
>[non-list reply]
>Nick Ing-Simmons <> wrote:
>|>  - why do we need new flag rather than SvREADONLY ?
>As I mentioned in the original post, clamping is different from readonly. 
>It seems to me that a readonly hash would mean that no changes would be
>allowed at all, including to its values.

The writability of the values could/should be controlled by the 
SvREADONLY bit of the value SVs.

Thus to get "clamp" just set flag on HV, to really lock it down
set it on the values then set on HV.

>(Which would be a nice feature as
>well, and even moreso, it would imply that we could then have readonly

We can already. What is needed is an interface - as a module ;-)

I am willing to put hooks into the core to get croaks when 
a READONLY hash is accessed.

You are not getting a new keyword 

>	Jeffrey
Nick Ing-Simmons

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