scala - 访问由 Scala REPL 创建的字节码

标签 scala bytecode read-eval-print-loop

有什么方法可以访问 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/

相关文章:

java - 这种奇怪的 Java 行为的原因是什么?

java - java字节码的不同行为

eclipse - 逆时针在eclipse中不使用步进调试器?

Java - 将文件扫描仪与用户输入扫描仪结合起来

python - 为什么这两个函数在dis.dis下反汇编后字节码是一样的?

common-lisp - 为什么我不能 (push 3 '()) in Common Lisp' s REPL?

scala - 在 Scala play 的 SimpleResult 中编写多部分响应

scala - 将 Tuple2 的值部分(即映射)合并为按 Tuple2 的键分组的单个映射

scala - 如何基于函数的type参数的类型参数编写具有多态返回类型的函数?

scala - Play的执行上下文与Scala Global