Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hou3c.UUCP Path: utzoo!watmath!clyde!burl!hou3c!ka From: ka@hou3c.UUCP (Kenneth Almquist) Newsgroups: net.lang.c Subject: Re: Set type Message-ID: <1030@hou3c.UUCP> Date: Tue, 19-Feb-85 16:43:56 EST Article-I.D.: hou3c.1030 Posted: Tue Feb 19 16:43:56 1985 Date-Received: Fri, 22-Feb-85 21:15:09 EST References: <10983@watmath.UUCP> <21000020@uiucuxc.UUCP> <354@snow.UUCP> <141@rtech.ARPA> <142@rtech.ARPA> <855@sjuvax.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 15 Creating sets in C is easy. To declare set element, use #define: #define RED 01 #define BLUE 02 #define GREEN 04 C has a union operator ("|"), an intersection operator ("&"), and even a set difference operator ("&~"). Of course, this approach limits you to sets which contain no more elements than are contained in an integer, but this limitation also tends to apply to PASCAL sets. It may be fun to talk about set operators instead of bitwise operators, but you aren't going to eliminate the existing bit operators from C, and we certainly don't need *both* set operators and bit operators. Kenneth Almquist