Here are some snippets from my Scala prompt. I import the reflection API and try reifying some expressions, as described in the docs here.
scala> import scala.reflect.runtime.{universe => ru}
scala> val str = "Duck I says."
scala> ru.showRaw(ru.reify(println(2)))
res40: String = Expr(Apply(Select(Select(This(newTypeName("scala")),
newTermName("Predef")), newTermName("println")), List(Literal(Constant(2)))))
scala> ru.showRaw(ru.reify(str.length))
res41: String = Expr(Apply(Select(Select(Select(Select(Select(Ident($line4),
newTermName("$read")), newTermName("$iw")), newTermName("$iw")),
newTermName("str")), newTermName("length")), List()))
I did not expect to see these symbols $line4
, $read
, and $iw
in the second one. What are they and why are they there?