开发者

Access bytecode created by Scala REPL

开发者 https://www.devze.com 2023-02-19 20:18 出处:网络
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).

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消