mfichman/apollo — Issue #41: Enums and Constants
Author: mfichman
Created: 2011-11-13 04:15:15+00:00
State: open

Add enums, which are basically implemented as a set of integers inside a class scope. For example:

CarState < Enum {
ON
BROKEN
OFF
}

Another alternative syntax is:

CarState = ON | BROKEN | OFF

Similarly, union types have a similar syntax:

JsonValue = String | Int | Float

Or:

JsonValue < Union {
String
Int
Float
}