Back in the Ada 83 days I looked into creating a reusable set package, along
the lines of the SET type available for Pascal and Modula-2. What I quickly
discovered was that Ada's support for Boolean operations on arrays of booleans
made it completely unnessecary. For all intents and purposes, you *do* have a
set type in Ada!
type Color is (Red, Green, Blue, Black, Teal);
type Color_Set is array (Color) of Boolean;
Palette : Color_Set;
if Palette(Red) then ...
Colorblind_Palette := Palette and Colorblind_Visible_Colors;
Palette := Palette or Colors_At_The_Artshop;
Unavailable_Colors := not Palette;
Admittedly, an implementation of a very large sparse set using only boolean
arrays is not the best way to go. But I have yet to ever need that