Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>update 2012-07-04</strong>:</p> <p><a href="https://plus.google.com/109369058791340660984" rel="nofollow noreferrer">Daniel SOBRAL</a> (also <a href="https://stackoverflow.com/users/53013/daniel-c-sobral">on SO</a>) details in his blog post "<a href="http://dcsobral.blogspot.fr/2012/07/json-serialization-with-reflection-in.html" rel="nofollow noreferrer">JSON serialization with reflection in Scala! Part 1 - So you want to do reflection?</a>" some of the features coming with reflection:</p> <blockquote> <p>To recapitulate, Scala 2.10 will come with a Scala reflection library.<br> That library is used by the compiler itself, but <strong>divided into layers through <a href="https://stackoverflow.com/questions/5172188/understanding-scalas-cake-pattern">the cake pattern</a>, so different users see different levels of detail</strong>, keeping jar sizes adequate to each one's use, and hopefully hiding unwanted detail.</p> <p>The reflection library also <strong>integrates with the upcoming macro facilities, enabling enterprising coders to manipulate code at compile time</strong>.</p> </blockquote> <hr> <p><strong>update 2012-06-14.</strong> (from <a href="https://stackoverflow.com/users/131615/eugene-burmako">Eugene Burmako</a>):<br> In <strong><a href="http://www.scala-lang.org/node/12702" rel="nofollow noreferrer">Scala 2.10.0-M4</a></strong>, we have released the new <strong>reflection API</strong> that will most likely make it into 2.10.0-final without significant changes.<br> More details about the API can be found: </p> <ul> <li>SO answer <a href="https://stackoverflow.com/questions/11020746/get-companion-object-instance-with-new-scala-reflection-api/11031443#11031443">Get companion object instance with new Scala reflection API</a></li> <li><a href="https://docs.google.com/document/d/1Z1VhhNPplbUpaZPIYdc0_EUv5RiGQ2X4oqp0i-vz1qw/edit?pli=1" rel="nofollow noreferrer">Scala Reflection SIP, June 2012</a> by Martin Odersky (<a href="http://en.wikipedia.org/wiki/SIP" rel="nofollow noreferrer">SIP</a>, actually "<a href="http://docs.scala-lang.org/sips/index.html" rel="nofollow noreferrer">Scala Improvement Process</a>")</li> <li><a href="https://github.com/scala/scala/commit/6bb5975289c5b11cb8c88dd4629286956b5d3d27" rel="nofollow noreferrer">summary and migration route from M3</a></li> </ul> <p>Extracts:</p> <blockquote> <p>Universes and mirrors are now separate entities:</p> <ul> <li>universes host reflection artifacts (trees, symbols, types, etc),</li> <li>mirrors abstract loading of those artifacts (e.g. <code>JavaMirror</code> loads stuff using a classloader and annotation unpickler, while GlobalMirror uses internal compiler <code>classreader</code> to achieve the same goal).</li> </ul> <p>Public reflection API is split into <strong><code>scala.reflect.base</code></strong> and <code>scala.reflect.api</code>. </p> <ul> <li>The former represents a minimalistic snapshot that is exactly enough to build reified trees and types. </li> <li>To build, but not to analyze - everything smart (for example, getting a type signature) is implemented in <code>scala.reflect.api</code>.</li> </ul> <p>Both reflection domains have their own universe: <code>scala.reflect.basis</code> and <code>scala.reflect.runtime.universe</code>. </p> <ul> <li>The former is super lightweight and doesn't involve any classloaders, </li> <li>while the latter represents a stripped down compiler.</li> </ul> </blockquote> <hr> <p>Initial answer, Sept. 2011: </p> <p>You can see evolutions of the reflect package in the <a href="https://github.com/scala/scala" rel="nofollow noreferrer">Scala GitHub repo</a>, with this two very recent commits:</p> <ul> <li><a href="https://github.com/scala/legacy-svn-scala/commit/ed89775a0551b4c4c29ac56490ce6f84e7954ea6" rel="nofollow noreferrer">Changes to Liftcode to use new reflection semantics, where a compiler uses type checking</a>.</li> <li><a href="https://github.com/scala/legacy-svn-scala/commit/719ba9939a3843ea75cefee1f5d6ba1e22fce373" rel="nofollow noreferrer">Started work on compiler toolbox that can compile reflect trees at runtime</a>.</li> </ul> <p>(Liftcode being, according to <a href="http://comments.gmane.org/gmane.comp.lang.scala.internals/2517" rel="nofollow noreferrer">this thread</a>, aims at simplifying "writing code that writes code")</p> <p>The class <a href="https://codereview.scala-lang.org/fisheye/browse/scala-svn/scala/trunk/src/compiler/scala/reflect/internal/Importers.scala?hb=true" rel="nofollow noreferrer"><code>scala/reflect/internal/Importers.scala</code></a> (created yesterday!) is a good example of using those latest reflection feature.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload