Is there a good place to get a thorough tutorial of Scala 2.10's reflection API? I see lots of blog posts written over the course of the last two years, but many of the details of these posts are already out of date.
Now that 2.10 is publicly available, is there any document that will walk me through how reflection works?
Types obtained through reflection can be instantiated by invoking their constructor using an appropriate “invoker” mirror (mirrors are expanded upon below). Let's walk through an example using the REPL: scala> case class Person(name: String) defined class Person scala> val m = ru. runtimeMirror(getClass.
Reflection is a feature in the Java programming language. It allows an executing Java program to examine or "introspect" upon itself, and manipulate internal properties of the program. For example, it's possible for a Java class to obtain the names of all its members and display them.
Check out the official reflection guide at http://docs.scala-lang.org/overviews/reflection/overview.html. Thanks a lot to Heather Miller who took time to assemble it!
Other sources available are: 1) the slides from one of my talks, 2) Daniel Sobral's blog posts, 3) Scaladoc links on the stub pages accessible via the URL provided above, 4) and Stack Overflow answers. I might've missed something here, please let me know if that's the case.
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