Enumerations: Difference between revisions

Content added Content deleted
(Added Prolog)
Line 1,434: Line 1,434:
Retro has a library named '''enum'''' for creation of enumerated values.
Retro has a library named '''enum'''' for creation of enumerated values.


<lang Retro>needs enum'
<lang Retro>'/examples/enum.retro include
( Creating a series of values )
0 ^enum'enum| a b c d |


{ 'a=10 'b 'c 'd=998 'e 'f } a:enum
( Create values individually )
</lang>
0 ^enum'enum a ^enum'enum b</lang>

The actual values for each subsequent enumerated value created are determined by the '''^enum'step''' function. This defaults to incrementing by 1, but can be altered as desired:

<lang Retro>with enum'
[ 10 * ] is step
0 ^enum'enum| a b c d |</lang>


=={{header|REXX}}==
=={{header|REXX}}==