简体   繁体   English

在Emacs中的REPL中执行> 1行Clojure代码

[英]Executing >1 line of Clojure code in the REPL from Emacs

I'm following the clojure tutorial here and it shows me how to execute one line of clojure code in the repl by invoking Cx Ce at the end of the line. 我在这里遵循clojure教程,它向我展示了如何通过在行尾调用Cx Ce来在repl中执行一行clojure代码。 Now how would I execute more than 1 line of clojure code...for example...if I was in a clojure file with lots of code but I only wanted to execute a subset in the REPL....any way to do that? 现在我将如何执行多于一行的Clojure代码...例如...如果我在一个Clojure文件中包含大量代码,但我只想在REPL中执行一个子集....任何方法那?

eg. 例如。

...
...
(defn hello-world
 []
 (printf "Hello World")
)
(hello-world)
;; I'd like to execute the previous 5 lines with a key combination
...
...

``` ```

The shortcut Cc Cc executes the entire sexp your on, the top-level form. 快捷键Cc Cc可以执行您的整个sexp,即顶层表单。 see all shortcuts for cider here 在这里查看苹果酒的所有快捷方式

  1. Select all the sexps you want to evaluate. 选择您要评估的所有六边形。
  2. Mx cider-eval-region to evaluate all those statements in order. Mx cider-eval-region按顺序评估所有这些语句。

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

相关问题 通过lein,命令行或emacs从命令选项卡应用程序切换器隐藏Clojure REPL - Hide Clojure REPL from command-tab application switcher via lein, command line, or emacs Clojure的Emacs CIDER repl-.profile中的环境变量丢失 - Clojure's Emacs CIDER repl - environment variables from .profile are missing emacs 中的 clojure cider repl 无法从核心异步回调打印 - clojure cider repl in emacs cant print from core async callback 如何在设置.emacs.d文件夹后从Emacs运行Clojure REPL - How to run the Clojure REPL from Emacs after setting up .emacs.d folder 如何将一行代码复制到REPL缓冲区并立即执行它,在Emacs中? - how to copy a line of code to the REPL buffer and immediately execute it, in Emacs? Clojure和ClojureScript REPL(emacs +苹果酒+靴子) - Clojure & ClojureScript REPL (emacs + cider + boot) 哪个repl在emacs里面用于clojure - which repl to use inside emacs for clojure 为什么我不能在emacs中的Clojure Cider REPL中从后台线程打印? - Why can't I print from background threads in Clojure Cider REPL in emacs? Emacs clojure repl不显示任何错误或异常 - Emacs clojure repl does not show any errors or exceptions 在emacs clojure / cider模式和REPL中使用本地jar文件 - Using local jar files with emacs clojure/cider mode and REPL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM