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

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

Thread Previous | Thread Next
July 19, 2001 17:36
Re: [PATCH for discussion] new feature: clamp %hash
Message ID:
On Thu, Jul 19, 2001 at 05:03:39PM -0700, Jeffrey Friedl wrote:
> schwern  <> wrote:
> |> On Thu, Jul 19, 2001 at 11:15:12AM -0700, Jeffrey Friedl wrote:
> |> > I added a new reserved word (I can hear the cringing already) "clamp".
> |> 
> |> Here's my thoughts about any new attempt to replace pseudo-hashes,
> My thought of clamp has never been that they are somehow a replacement for
> pseudo-hashes. They're sort of apples and oranges (although both are orbed
> fruits).

I'm worried about spawning multiple half-way solutions to the problem
and sticking them into the core.

> Since you can unclamp (or declamp, or whatever) something, it doesn't
> provide security or anything.

The declamping feature is actually very nice.

> |> clamp() unfortunately violates this.  You have to put all your keys in
> |> the hash before clamping it, so there's effectively no way to
> |> distinguish between a valid key which has not been set yet and a valid
> |> key which is set to undef
> exists()

Here's the problem.  How can I have a clamped keyset of 'foo' and
'bar' where C<exists $clamped_hash{foo}> is false?

Michael G Schwern   <>
Perl6 Quality Assurance     <>       Kwalitee Is Job One

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