简体   繁体   English

用CounterClockwise和Eclipse评估Clojure REPL

[英]Evaluation in Clojure REPL with CounterClockwise and Eclipse

I normally use Emacs but was inspired to try CCW + Eclipse again. 我通常使用Emacs但受到启发再次尝试CCW + Eclipse。 I have a Clojure test project with a source file src/user.clj with the following contents: 我有一个带有源文件src / user.clj的Clojure测试项目,其中包含以下内容:

(ns user)

(println "hi")

I have a REPL which I started with Window->Show View->Other->Clojure Views->REPL. 我有一个REPL,我开始使用Window-> Show View-> Other-> Clojure Views-> REPL。

When I select the println expression (all of '(println "hi")') and hit Command-enter, the expression itself gets echoed in the REPL window, but no output occurs. 当我选择println表达式(全部为'(println“hi”)')并按下Command-enter时,表达式本身会在REPL窗口中回显,但不会发生输出。 Similar with expressions like '(take 10 (range))'. 与'(取10(范围))'等表达式相似。

If I type the expression in the REPL directly, and hit Enter, I get 如果我直接在REPL中键入表达式,然后按Enter,我就会得到

=> (take 10 (range))

but there doesn't seem to be any additional output of the evaluation. 但似乎没有任何额外的评估结果。

Thanks for any ideas. 谢谢你的任何想法。 I looked over the docs but nothing obvious jumped out at me. 我查看了文档,但没有任何明显的东西跳出来。

You need to be connected to a REPL to get a response. 您需要连接到REPL才能获得响应。

There are two options: 有两种选择:

  • Connect to an existing REPL 连接到现有的REPL
  • Run your project as a Clojure application and automatically connect to it's REPL. 将项目作为Clojure应用程序运行并自动连接到它的REPL。

To connect to an existing REPL, you can use Window -> Connect to REPL. 要连接到现有REPL,可以使用Window - > Connect to REPL。

To run your project, Right click your project; 要运行项目,请右键单击您的项目; Run As -> Clojure Application. 运行方式 - > Clojure应用程序。 If that's not an option, Right Click -> Configure -> As Clojure Application 如果这不是一个选项,请右键单击 - >配置 - >作为Clojure应用程序

Sounds like your REPL is disconnected - it needs to be connected to a running Clojure process in order for you to interact with the live environment. 听起来您的REPL已断开连接 - 它需要连接到正在运行的Clojure流程才能与实时环境进行交互。

I usually just launch a REPL and load the file simultaneously by pressing Ctrl-Alt-L in the code editor window. 我通常只需在代码编辑器窗口中按Ctrl-Alt-L启动REPL并同时加载文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在日食中运行clojure(逆时针) - running clojure in eclipse (counterclockwise) Eclipse-Clojure-逆时针插件-用于评估REPL名称空间(而非文件名称空间)中选择的快捷方式 - Eclipse - Clojure - Counterclockwise plugin - shortcut for evaluating selection in REPL namespace (not file namespace) 如何在带有逆时针方向的Eclipse中使用已编译的Clojure类 - How to use a compiled Clojure class in Eclipse with Counterclockwise 如何在Eclipse / CounterClockWise中重新格式化/重新生成Clojure代码? - How to reformat/reindent Clojure code in Eclipse/CounterClockWise? 无法在Eclipse逆时针Clojure插件中创建项目 - Cannot Create Project in Eclipse Counterclockwise Clojure Plugin 如何在Eclipse的CounterClockwise-REPL中运行doc命令? - How is it possible to run the doc-command in a CounterClockwise-REPL in Eclipse? 在Eclipse / CounterClockWise中使用线程时,输出将发送到控制台而不是REPL - Output is sent to console instead of REPL when using threads in Eclipse/CounterClockWise Eclipse(逆时针)-新的Clojure项目:[Exception]无法加载模板,Leiningen - Eclipse (Counterclockwise)- New Clojure Project: [Exception] Could not load template, Leiningen 逆时针REPL的最后输入? - Last input in Counterclockwise REPL? 如何使用Eclipse和CounterClockwise查看Clojure函数的调用层次结构 - How to see a Clojure function's call hierarchy using Eclipse and CounterClockwise
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM