At 04:38 PM 10/2/00 -0400, Uri Guttman wrote:
>now we still have the problem of designing a clean iterator object that
>will work with perl hashes. the usual questions arise: what happens if
>you modify the hash during the iteration? where is the state of
>iteration stored (in the object most likely)? how can the iterator state
>be accessed/managed?

I'm currently leaning towards having a "next" entry in the vtable that 
takes a key value and returns the next entry in the (hash|array|sparse 
array|bitmap|string) and leave it at that. No state per se--if the key 
we're passing in doesn't exist it doesn't much matter--we find where it 
would be and get the next one.

Of course stateless iterators have their own problems, but I don't think 
that we have any good options, just a list of mildly unpalatable ones.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to