Programming without enumerations in Oberon
Charles Lins · ACM SIGPLAN Notices · 1990
When this author attempts to explain the features of Niklaus Wirth's language Oberon [1] to other programmers familiar with Pascal [2] and Modula-2 [3], he has consistently encountered resistance when the listener(s) learn that enumerations are no longer a part of the language. Many programmers have found enumerations useful even without the ability to extend an enumeration across module boundaries-- one of the reasons that Niklaus Wirth chose to delete them as a syntactic and semantic construct [1]. Additional reasons given by Professor Wirth for the removal of enumerations included: indiscriminate use of enumerations leading to a pompous style contributing to verbosity rather than clarity, and specific import rules for enumerations wherein the import of a type caused automatic import of the associated constant identifiers. In contrast, the C programming language, which lacked enumerations for many years, now has them specified as a part of the ANSI C standard. In addition, C++, Bjarne Stroustrup's object-oriented extension to C, contains enumerations as well [7]. Obviously, there is some disagreement between language designers regarding the utility of enumerations as a specific language feature. The remainder of this article discusses (1) how one would provide the equivalent functionality of enumerations when they are not present as a part of the programming language, (2) how adding enumerations into the syntax of Oberon would needlessly complicate the treatment of array indices, and (3)