Enums
An enum declares a closed set of named values:
public enum Color Red Green BlueendRefer to a case through its enum type:
local selected: Color = Color.Bluelocal isBlue = selected == Color.BlueEnums are nominal. Two declarations with the same case names are still different types, and equality or inequality requires both operands to have the exact same enum type.
Representation and limits
Section titled “Representation and limits”Declaration order assigns a compact zero-based UInt32 discriminant internally, but there is no implicit conversion between an enum and an integer. Enums support == and ~=; ordering and arithmetic are rejected.
Use an enum when alternatives have no payload. Use a tagged union when cases carry different data. rc.3 does not implement custom discriminants, flags enums, case iteration, or explicit integer conversion.
