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

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

Thread Previous | Thread Next
From:
Jeffrey Friedl
Date:
July 23, 2001 11:42
Subject:
Re: [PATCH for discussion] new feature: clamp %hash
Message ID:
200107231841.LAA23625@ventrue.corp.yahoo.com

Arthur Bergman <arthur@contiller.se> wrote:
|> 01-07-23 19.56, skrev Miller, Scott L p,Ae(B Scott.L.Miller@compaq.com 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.
	Jeffrey

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