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

RE: [PATCH] core-only patch for clamp/readonly hashes

Thread Previous | Thread Next
From:
Brent Dax
Date:
October 30, 2001 16:06
Subject:
RE: [PATCH] core-only patch for clamp/readonly hashes
Message ID:
FJELLKOPEAGHOOODKEDPMEPJCIAA.brentdax@cpan.org
Jeffrey Friedl:
# One important concept is that if a key doesn't exist, exists() should
# return false. It may be allowed, but that doesn't mean it exists().
# Hopefully, everyone can agree with this.

Yeah, but with one suggestion: C<exists> currently returns the empty
string on false.  Maybe we can have it return something else that's
false--0 or undef--if the key is allowed but doesn't currently exist.

# I feel that scalar(keys()) should return the same number of
# items that keys()
# returns, just as it does now.

Yup.

# I would feel that keys() should return only keys that
# exist(), just as it
# does now.

Yup.

# It would be nice to get a list of allowed keys, or perhaps
# keys that are
# allowed but don't currently exists. These functions could be
# left up to the
# XS module.

Sure.

# The overall functionality I think is *useful* is that you can
# tell a hash
# ``Here are the keys that are allowed -- so long as keys are
# always from
# this list, do whatever you want''. The approach I've taken
# implements this
# with virtually no cost.

Absolutely.  I'm looking forward to
/clamping|restricting|$whatever_else_we_call_it/ in 5.8.

--Brent Dax
brentdax@cpan.org
Configure pumpking for Perl 6

When I take action, I’m not going to fire a $2 million missile at a $10
empty tent and hit a camel in the butt.
    --Dubya


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