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

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

Thread Previous | Thread Next
Jeffrey Friedl
July 23, 2001 11:42
Re: [PATCH for discussion] new feature: clamp %hash
Message ID:

Arthur Bergman <> wrote:
|> 01-07-23 19.56, skrev Miller, Scott L p,Ae(B f,Av(Bljande:
|> > In my mind at least, clamping and readonly are 2 different animals.
|> > A hash that has been "clamped" could still have its values modified,
|> > but can't have a new key added, but a hash that is readonly wouldn't
|> > be able to add a key, or have its values modified...
|> > 
|> > -Scott L. Miller
|> To clamp the hash, you make the hash readonly, to make the entries readonly,
|> well, just make the entries readonly?

I think that's the idea, although I think it's important to use different
ways to clamp a hash and to make it readonly. If "readonly(something)"
makes something readonly, then I think that readonly(%hash) should both
clamp the hash and make all its values readonly.  On the other hand,
if we make the user have to remember that readonly(%hash) really doesn't
make the whole thing readonly, we're getting dirtier rather than cleaner.

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