In computer programming, an enumerated type is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type.
| FactSnippet No. 1,624,865 |
In computer programming, an enumerated type is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type.
| FactSnippet No. 1,624,865 |
An enumerated type can be seen as a degenerate tagged union of unit type.
| FactSnippet No. 1,624,866 |
In other words, an enumerated type has values that are different from each other, and that can be compared and assigned, but are not specified by the programmer as having any particular concrete representation in the computer's memory; compilers and interpreters can represent them arbitrarily.
| FactSnippet No. 1,624,867 |
In some languages, the declaration of an enumerated type intentionally defines an ordering of its members; in others, the enumerators are unordered; in others still, an implicit ordering arises from the compiler concretely representing enumerators as integers.
| FactSnippet No. 1,624,868 |
Values and variables of an enumerated type are usually implemented with some integer type as the underlying representation.
| FactSnippet No. 1,624,869 |
Conceptually, an enumerated type is similar to a list of nominals, since each possible value of the type is assigned a distinctive natural number.
| FactSnippet No. 1,624,870 |
In Pascal, an enumerated type can be implicitly declared by listing the values in a parenthesised list:.
| FactSnippet No. 1,624,871 |
An enumerated type is an ordinal type, and the pred and succ functions will give the prior or next value of the enumeration, and ord can convert enumeration values to their integer representation.
| FactSnippet No. 1,624,872 |
Could be used to define a Enumerated type that allows mathematical sets of suits to be represented as an enum cardsuit by bitwise logic operations.
| FactSnippet No. 1,624,873 |
The underlying Enumerated type can be specified directly, which allows "forward declarations" of enumerations:.
| FactSnippet No. 1,624,874 |
Alternatively, enumeration cases can specify associated values of any Enumerated type to be stored along with each different case value, much as unions or variants do in other languages.
| FactSnippet No. 1,624,875 |
The member Enumerated type specifier is not valid as a Common Lisp Object System parameter specializer, however.
| FactSnippet No. 1,624,876 |