At 06:09 PM 10/2/00 -0400, Uri Guttman wrote:
> >>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
>
> DS> I'm currently leaning towards having a "next" entry in the vtable
> DS> that takes a key value and returns the next entry in the
> DS> (hash|array|sparse array|bitmap|string) and leave it at that. No
> DS> state per se--if the key we're passing in doesn't exist it doesn't
> DS> much matter--we find where it would be and get the next one.
>
>hmm, that means 'next' does a lookup based on the key passed
>in. currently next uses the iterator state which is much faster. i think
>next should be faster than a regular lookup but the semantics don't
>specify that. your idea still fails when the hash gets modified during
>iteration (does any iterator survive munging during iteration? other
>than full copies?)
No it doesn't. Granted, you may not pick up things that are added but hash
to things before the key you're using, but that's just Too Darned Bad. :)
All the methods have some downside or other.
Also, don't assume that the key passed in is just a string. It could well
be a string/hashval pair, or a string/hashval/magic triple, and we use the
fast method with the others as fallbacks.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk