11

I would like to launch a Scala Swing application from the command line, then after the application is started, drop into the Scala REPL to use as a control interface.

Ideally I would also like to pre-bind some variable names. Even better would be using a Java2D terminal emulator for the REPL, but I couldn't find anything appropriate.

Does the Scala REPL have a public API?

4

1 回答 1

13

您可能会问同样的事情,就像这个问题一样,是吗?您还可以做其他事情。有一种方法可以只用代码调用 REPL,然后得到回复,这取决于你想要什么,这可能更合适。如果这就是你想要的,请澄清它,我会研究它。

至于Java2D终端,我认为使用Console's和就足够了setIn,但我可能弄错了。您可能想看看在环境中嵌入 REPL 的其他一些工作是如何做的。我认为至少有三个,但快速搜索只有Kojo,它是基于 Netbeans 的。setOutsetErr

于 2010-03-16T19:18:14.857 回答