Bytecode Access Created Using Scala REPL

Is there a way to access the bytecode generated by the REPL (i.e. the Scala line that you just typed and executed in the REPL).

I need this to load a class on a remote node.

+6
scala bytecode read-eval-print-loop
source share
1 answer

Check out this thread: http://thread.gmane.org/gmane.comp.lang.scala.internals/4506 . This may give you some ideas.

Is there a way to use findBytesForClassName to restore the original bytes of a class? I am trying to directly serialize REPL objects to parallelize with other JVMs and I cannot use RMI.

Answer:

Take a look at Javap.scala and then at ILoop.scala. Command: javap does exactly what you want. The key is pathToFlatName.

This will require 2.9. The participants in this thread are also users of SO ...

+5
source share

All Articles