How does the Enumeration.Value of a scala enumeration knows the name of the member? -


in scala, can create enumeration this:

object weekday extends enumeration {   val monday, tuesday = value } 

you can call tostring() name of member @ runtime

val name = weekday.monday.tostring // name = "monday" 

how possible? value method creates new object time, how can method access name of declared member without of compiler? pure scala magic me.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -