[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]
Table Set and Iterator protocol
- To: <us>, <tribble>
- Subject: Table Set and Iterator protocol
- From: Eric Dean Tribble <tribble>
- Date: Wed, 23 Aug 89 12:05:36 PDT
Yesterday we had a short running meeting (from one room to the next)
about collection protocols. I recall input from MarkM, Hugh, Dean, and
I'll let markm list the side-effecting Set protocol. I expect that
the same protocol should work for Bags.
The new Iterator protocol is:
iterator->with(elem) returns a new iterator that includes elem as well
as all the previous elements. This replaces add(elem).
iterator->withoutIt returns and iterator without the current iterand
(the pun is deliberate). This replaces iteator->discard.
iterator->count returns the number of elements in the iterator (the
number of times withoutIt could be preformed on successive results).
This replaces size, and we agreed that it should replace the size and
length messages for all collection like classes: (Table, Set, Tuple,
BitArray, Iterator, etc.)
Some further soggestions from me:
First a name proposal: Since a side-effect-free set is called a SET,
Scheme naming conventions suggest that a Set with side-effects should
be called a Set! (or SetBang) (clink). I far prefer this to FasciSet
(which I could hardly bring myself to say).
BitArray should be renamed WordArray. The interaction protocol is for
interacting with words of various sizes rather than bits. The
protocol should be very like that of Table. If you want to know the
word size, retrieve a word and ask it how big it is. Etc.