You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I define an Enum. Say @enum Fruit apple=15 banana=27. Given the value I would like to get the name of the the enumerated type. One way to get this is.
julia> Base.Enums.namemap(Fruit)
Dict{Int32, Symbol} with 2 entries:5=>:apple19=>:banana
It would be convenient to have a method dedicated to this. I think nameof is suitable here. The resultant behaviour being nameof(Fruit(5)) == :apple
I'm happy to implement it if this makes sense.
The text was updated successfully, but these errors were encountered:
When I define an Enum. Say
@enum Fruit apple=15 banana=27
. Given the value I would like to get the name of the the enumerated type. One way to get this is.It would be convenient to have a method dedicated to this. I think
nameof
is suitable here. The resultant behaviour beingnameof(Fruit(5)) == :apple
I'm happy to implement it if this makes sense.
The text was updated successfully, but these errors were encountered: