Enumerations: Difference between revisions
→{{header|ATS}}
Line 272:
=={{header|ATS}}==
The wording of the task
<lang ATS>datatype my_enum =
Line 279:
| value_c</lang>
Within ATS itself, it is a special case of recursive type definition. Similar facilities are available in ML dialects and other languages.
To do it with explicit values, I would simply define some constants, probably with '''#define''' (so I could use them in static expressions, etc.):▼
▲To
<lang ATS>#define value_a 1
#define value_b 2
|