The member of the enum T called name, and whether there is one.
enum_name_to_value :: ($T: Type, name: string) -> (T, bool)
Parameters
- $T: Type
- name: string
Returns
- T
- bool
Color :: enum { RED; GREEN; BLUE; }
value, found := enum_name_to_value(Color, "GREEN");
assert(found && value == .GREEN);
_, found = enum_name_to_value(Color, "PINK");
assert(!found);