Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!bloom-beacon!oberon!cit-vax!ucla-cs!zen!ucbvax!ECNCDC.BITNET!MSRS002 From: MSRS002@ECNCDC.BITNET.UUCP Newsgroups: comp.lang.modula2 Subject: Sets Message-ID: Date: Wed, 30-Sep-87 23:26:00 EDT Article-I.D.: UCF1VM.INFO-M2%87093023532046 Posted: Wed Sep 30 23:26:00 1987 Date-Received: Sat, 3-Oct-87 01:56:30 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Info-Modula2 Distribution List Distribution: world Organization: The ARPA Internet Lines: 24 How big should a set be? Wirth created the idea of a bitset because it would be easy to implement a very efficient way to do sets the size of the computer's word. This means sets are likely to be 8, 16 or 32 bits, possibly other sizes, depending on the implementation. Bruce MacLennan in his book, Principles of Programming Languages presents an idea which I quite agree with. "The only reasonable numbers are zero, one, and infinity." Since zero and one are not very usefull numbers when you're dealing with sets ( they're rather special case sets ), I would propose a that the limit be infinity. The actual limit would be dependant on the available memory for storing the set, but it could be a very large number. Since the type of each set is known, the compiler could determine how much memory is required to store the set. Now, we have the ability to say something like SET OF CARDINAL, since most implementations have cardinal values of 0 .. 65535. If you were to store one member per bit, the entire set could be represented in 8k {of memory, assuming 8 bit bytes. This is a reasonable size block of memory to consider even on older 8 bit machines. Tom Ruby MSRS002@ECNCDC