enum from/to string
#11655
Replies: 4 comments 3 replies
-
Yes, this will be implemented. |
Beta Was this translation helpful? Give feedback.
0 replies
-
#4180 implemented this, did it not? If so, this can be closed. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This issue is also about the opposite: string to enum. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I arrived at this discussion from Google. Haven't enums been implemented from strings yet? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
V version: V 0.1.25 876b73f
OS: macOS 10.15
What did you do?
enum foo {bar}�
eprintln(foo.bar.str)
What did you expect to see?
all enum types should provide a compiler helper to resolve an enum type by string or get the string representation of the enum type. it is so tedious to do that in GLIB programs for example, as well as in C, and i think V should provide such helpers otu of the box to avoid the ugly spaguetti in vlib/compiler/main.v - os_from_string(os string) pref.OS
What did you see instead?
Beta Was this translation helpful? Give feedback.
All reactions