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

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

Thread Previous | Thread Next
Tim Bunce
July 20, 2001 15:45
Re: [PATCH for discussion] new feature: clamp %hash
Message ID:
On Fri, Jul 20, 2001 at 09:09:56AM +0100, Nick Ing-Simmons wrote:
> 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
> >scalars.)
> 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.

FWIW, I agree with Nick entirely.


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