Auto-generate MyEnumType.all() method that returns an array of all values of type MyEnumType #11646
elimisteve
started this conversation in
Ideas
Replies: 1 comment
-
Iterator over enum values is already possible, see https://github.com/vlang/v/blob/master/doc/docs.md#values |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to be able to do something like this:
Then we also wouldn't have to have things like we see in
vlib/compiler/main.v
, as one example --but could instead simply do
if a
str()
method is also created for eachenum
type that returns the name of the value.This was suggested in the docs, too, and is a great idea:
Beta Was this translation helpful? Give feedback.
All reactions