Access bytecode created by Scala REPL
Is there any way to access the bytecode produced by开发者_JAVA百科 REPL (i.e. the line of Scala you just typed and executed in REPL).
I need it for class loading to a remote node.
Look at this thread: http://thread.gmane.org/gmane.comp.lang.scala.internals/4506. It may give you some ideas.
Is there a way for me to use the findBytesForClassName to recover the original bytes of the class? I'm trying to directly serialize REPL objects for parallelization to other JVMs and I can't use RMI.
Answer:
Look at Javap.scala and then ILoop.scala. The :javap command does exactly what you want. The key is pathToFlatName.
It would require 2.9. The participants to that thread are also SO users...
精彩评论