From: Colin A. <col...@go...> - 2008-03-20 12:58:04
|
On 20/03/2008, Eric Bezault <er...@go...> wrote: > 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'? Yes, that sounds the best compromise. > 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. There is nothing linear about for_all_with_keys and there_exists_with_keys. Do_all_with_index/do_if_with_index imply a linear ordering, so we won't want them in DS_TABLE. I see no implied linearity with do_all_with_keys, do_if_with_keys (or for that matter do_all and do_if, just from the names). It all depends upon what the header comment says. So for do_all_with_keys we can just word the header comment to state that no particular order may be relied upon. Likewise for do_if_with_keys. Note that this will allow for concurrent implementations using SCOOP or other concurrent technologies. |