Sep-03-2020, 12:27 AM
Enum's and their derivatives IntEnum, IntFlag and Flag seem to do quite a lot of what I think I need to do, so I will study them carefully.
Is there any syntactic sugar that would permit the names of Enum's and derivatives to be used WITHOUT prefixing the class name?
I just don't see the logic in having to prefix yet another name in front of a name that I define uniquely in the first place.
E.G., if I have an Enum class of "Colors", why do I have to use Colors.RED instead of just RED?
Basically I'm imagining some syntactic construct similar to the Pascal "with" statement which permits structure field names to be used in a block of code without needing to use the structure name as a prefix for them.
I won't be surprised if there is no such "sugar", but a fellow can wish.
Peter
Is there any syntactic sugar that would permit the names of Enum's and derivatives to be used WITHOUT prefixing the class name?
I just don't see the logic in having to prefix yet another name in front of a name that I define uniquely in the first place.
E.G., if I have an Enum class of "Colors", why do I have to use Colors.RED instead of just RED?
Basically I'm imagining some syntactic construct similar to the Pascal "with" statement which permits structure field names to be used in a block of code without needing to use the structure name as a prefix for them.
I won't be surprised if there is no such "sugar", but a fellow can wish.
Peter