Why is @enum 0-based?

Wow, it makes a lot more sense when you put it that way! The @enum Switch::Bool begin On; Off; end example really drives the point home. As an aside, I’ve read the docs for @enum, but I hadn’t quite realized that @enum EnumName[::BaseType] meant I could optionally annotate my enum type name, even though I know that’s how square brackets are used in other parts of the docs. So thanks on both accounts!

2 Likes