From: Eric B. <er...@go...> - 2008-03-20 14:24:19
|
Colin Adams wrote: > 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 should have said that DS_TABLE is not a descendant of DS_TRAVERSABLE (rather than a descendant of DS_LINEAR). I would say that `do_all_with_index' belongs to DS_INDEXABLE. It has been added to DS_LINEAR for convenience (perhaps DS_LINEAR should have been a descendant of DS_INDEXABLE). > 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. If we follow the same reasoning, that `do_all', `there_exists', etc. should be moved to DS_CONTAINER. -- Eric Bezault mailto:er...@go... http://www.gobosoft.com |