-
Some objects
are associated with a small set of values.
-
And names are associated with
each of the possible values.
-
Suppose we are
representing a piece of four part harmony.
-
We want to refer to the four parts as
soprano,
alto,
tenor
and
bass.
-
Some programming languages
provide a means for declaring types
that represent a small number of values.
-
Such types are
enumeration types,
enumerated types
or
enum types.
-
First language: Pascal. Later: Modula-2, Ada, C, C++ and C#.
-
Notable exception (until now): Java.