有什么方法可以访问 REPL 生成的字节码(即您刚刚在 REPL 中键入和执行的 Scala 行)。
我需要它将类加载到远程节点。
最佳答案
看看这个帖子:http://thread.gmane.org/gmane.comp.lang.scala.internals/4506 .它可能会给你一些想法。
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.
回答:
Look at Javap.scala and then ILoop.scala. The :javap command does exactly what you want. The key is pathToFlatName.
它需要2.9。该线程的参与者也是 SO 用户...
关于scala - 访问由 Scala REPL 创建的字节码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5447888/