It is a well known fact that structural types are implemented through reflection. Are there maybe any other language constructs which use reflection?
This is closely related to structural types, but any anonymous object instance, ie
new { def print = ("hello world") }.print
will use reflection.
http://scala-programming-language.1934581.n4.nabble.com/Structural-types-reflection-td3071599.html
Enumerations use reflection to find out about all of the possible values for the enumeration for the nameOf function. (See the populateNameMap method in Enumeration.scala). This is done once, the first time you call nameOf for a particular Enumeration type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With