Enumerations: Difference between revisions
Content added Content deleted
Line 272: | Line 272: | ||
=={{header|ATS}}== |
=={{header|ATS}}== |
||
The wording of the task |
The wording of the task seems centered on C, where an '''enum''' is a notation for type '''int''', but it is true that the following type will be translated by the ATS compiler to C integers: |
||
<lang ATS>datatype my_enum = |
<lang ATS>datatype my_enum = |
||
Line 279: | Line 279: | ||
| value_c</lang> |
| 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. |
|||
⚫ | |||
⚫ | |||
<lang ATS>#define value_a 1 |
<lang ATS>#define value_a 1 |
||
#define value_b 2 |
#define value_b 2 |