## enm - Enumerations

### Module Description

The enm module implements simple enumerations.

### Module Words

#### Enumerations syntax words

begin-enumeration ( -- enum-sys )
  Start an enumeration definition, the first enumeration will start from 0
end-enumeration ( enum-sys -- )
  End an enumeration definition

#### Enumeration definition words

enum: ( enum-sys "<spaces>name" -- enum-sys ; -- n )
  Define an enumeration, increment for the next enumeration, return the enum value
>enum: ( enum-sys n "<spaces>name" -- enum-sys ; -- n )
  Define an enumeration starting with n, return the enum value

### Examples

    include ffl/enm.fs

    \ Example: number names

    begin-enumeration
      enum: zero            \ Default: an enum start with 0
      enum: one
      enum: two
      enum: three
      enum: four
      enum: five
    end-enumeration

    .( Enum zero: ) zero . .(  and three: ) three . cr

    \ Example: month names

    begin-enumeration
      1
      >enum: january        \ Start this enumeration with 1
      enum:  february
      enum:  march
      enum:  april
      enum:  may
      enum:  june
      enum:  july
      enum:  august
      enum:  september
      enum:  october
      enum:  november
      enum:  december
    end-enumeration

    .( January: ) january . .( and december: ) december . cr

generated 03-Jun-2010 by ofcfrth-0.10.0