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

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

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
October 31, 2001 01:03
Subject:
Re: [PATCH] core-only patch for clamp/readonly hashes
Message ID:
20011031090330.660.2@bactrian.elixent.com
Jeffrey Friedl <jfriedl@yahoo.com> writes:
>
>|> IMHO I would still rather keys returned the allowed set - it is useful,
>|> and avoids the overhead of maintaining the "realkeys" count (even if we
>|> can re-use the NV as has apparently been done).
>
>As I mentioned in one (probably lost) message, I've figured out a way to
>maintain the "realkeys" w/o any overhead in the normal case. I didn't send
>a patch because I don't want to flood the list with patches while basic
>semantics are still being discussed (even though I thought that the basic
>semantics were fairly well hashed out during the short thread in August).
>
>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.

Agreed.

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

Agreed.

>
>I would feel that keys() should return only keys that exist(), just as it
>does now.
>
>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.

That is where you and I differ. I think that keys should return the list
of allowed keys. I am not 100% sure though.


>
>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''.

Agreed.

>The approach I've taken implements this
>with virtually no cost.

Will study it ;-)

>
>
>At this point, I'm fairly confused as to who thinks what, due to the
>misordering of messages, lost messages, etc. Maybe things will resync
>tomorrow. Until then, from what I've seen so far, I still feel that the patch
>
>http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-10/msg01305.html
>
>pretty much does what most people are asking for (although I would like to
>make the small implementation change I mentioned above).
>
>        Jeffrey
--
Nick Ing-Simmons
http://www.ni-s.u-net.com/



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