[英]running clojure in eclipse (counterclockwise)
I'm learning clojure on eclipse (counterclockwise plugin). 我正在学习日食(逆时针插件)。
This is simple bit of code that I'm trying to run: 这是我正在尝试运行的简单代码:
(ns ClojureTest.core)
(let [input (read-line)]
(if (= "x" input)
(do
(println "Exit")
(System/exit 0)
)
(do
(println input)
(recur)
)
)
)
UPDATE: I managed to screw it up even further. 更新:我设法进一步搞砸了。 Now when I click "Run" the console ignores any input as if the application wasn't even running...
现在,当我单击“运行”时,控制台会忽略任何输入,就像应用程序甚至没有运行一样...
UPDATE2 I've restarted eclipse and the previous problem was solved. UPDATE2我重启了eclipse,之前的问题解决了。 Now I can run the app in the console again.
现在我可以再次在控制台中运行该应用程序。 I have no idea what happened.
我不知道发生了什么。 The only difference I can see is that when I messed it up - the REPL window title looked like this:
我能看到的唯一区别是,当我搞砸了它时 - REPL窗口标题看起来像这样:
REPL @ nrepl://127.0.0.1:60429 (user)
And after restarting eclipse it came back to this: 重新启动eclipse之后又回到了这个:
REPL @ nrepl://127.0.0.1:60001 (ClojureTest.core)
I have no idea what this means. 我不知道这是什么意思。
You only need one open REPL per project. 每个项目只需要一个打开的REPL。 Once opened, you can evaluate changed code from an existing file (namespace), by choosing so from the Clojure menu.
打开后,您可以从Clojure菜单中选择,从现有文件(命名空间)中评估更改的代码。 The selection or entire file, depending on what you choose, is then sent to the REPL for evaluation.
根据您的选择,选择或整个文件将被发送到REPL进行评估。 You can try out your changes immediately by calling functions from the REPL.
您可以通过调用REPL中的函数立即尝试更改。 This is called interactive development.
这称为交互式开发。 There is no need to recompile your entire project, before you can try out changes.
在尝试更改之前,无需重新编译整个项目。
The developers of CCW just chose the action for the Run button to be 'open a REPL for the existing project'. CCW的开发人员只是选择Run按钮的操作为“打开现有项目的REPL”。 Use it only once and don't keep pressing it, while developing.
在开发过程中,只使用一次并且不要持续按压它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.