Why does the first enum member value default to zero instead of one?

mthelm85
Tue, 13 Sep 2022 15:27:17 +0000
Internals & Design

I’m just curious since Julia uses 1-based indexing.

E.g.

julia> @enum Color Red Blue

julia> Red
Red::Color = 0

julia> Blue
Blue::Color = 1

4 posts - 4 participants