Jump to content

Enumerations: Difference between revisions

m
(Added Prolog)
Line 1,434:
Retro has a library named '''enum'''' for creation of enumerated values.
 
<lang Retro>needs enum'/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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.