From: Eric B. <er...@go...> - 2008-03-20 11:20:37
|
Colin Adams wrote: > Quite often I have a need to iterate over a DS_HASH_TABLE and inspect > both the item and the key. Currently I have no choice but to use a > cursor, as the features in the Iteration feature clause do not pass > the key to the agent. I sometimes have the same need. > It would be nice to have do_all_key, do_if_key etc. where the agent > receives both the item and the key. Ideally, these would be declared > for DS_TABLE. These feature names suggest that only the key is passed to the agent. I think that we need the three kinds of iterators: over the items, over the keys, and over both. The most difficult part is to find names. What about `do_all', `do_all_key' and `do_all_keyed'? Any better suggestion? Well, in fact to iterate only on keys I guess we can do `my_table.keys.do_all'... So, we might need only two kinds of iterators after all. What about `do_all' and `do_all_with_key', the latter being similar to `do_all_with_index'? Note that DS_TABLE is not linear. Only DS_SPARSE_TABLE is. I don't remember why DS_TABLE is not linear, but I'm not currently in a mood to change that to make it linear. -- Eric Bezault mailto:er...@go... http://www.gobosoft.com |