Set type

Angus Greiswald the fourth ag4 at pucc-h
Fri Feb 22 02:23:09 AEST 1985


> 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.

Well, that doesn't limit you, just like it *doesn't* limit you in Pascal.
Use an array of ints.  Of course, then the code can get crufty.  That's
why sets are usually so inefficient in Pascal.  They are an interesting
idea, though.  Can anyone think of a good example where using sets seems
to be the best solution?  If so, perhaps we could work at coming up
with a good set of macros to handle sets right.

--
Jeff Lewis                                                     vvvvvvvvvvvv
{decvax | hao | cbosgd | masscomp | uiucdcs | sequent | ihnp4}!pur-ee!lewie
                                                               ^^^^^^^^^^^^



More information about the Comp.lang.c mailing list