简体   繁体   English

如何在emacs中清除并重新加载我的nrepl会话?

[英]How can I clear and reload my nrepl session in emacs?

I am working with emacs and nrepl. 我正在使用emacs和nrepl。 How can I do the following: 如何执行以下操作:

  1. Exit nrepl (currently I just kill the buffer) 退出nrepl (当前我只是杀死缓冲区)

  2. Reload everything I was working with in nrepl . 重新加载我在nrepl使用的nrepl

The problem I'm trying to solve by doing this is that when I have loaded an ns form and it has an error, I am unable to load the correct code because it keeps giving me the previous error. 我正在尝试通过执行此操作来解决的问题是,当我加载了ns表单并且出现错误时,我无法加载正确的代码,因为它一直在给我以前的错误。

1) Exit the nrepl (currently I just kill the buffer) 1)退出nrepl(目前我只是杀死缓冲区)

Mx nrepl-quit

2) Reload everything in the nrepl. 2)重新加载nrepl中的所有内容。 (I have this problem when I haave loaded the ns, and it has an error. Then I am unable to load the correct code, it still keeps giving me the previous error) (我在加载ns时遇到了这个问题,它有一个错误。然后我无法加载正确的代码,它仍然不断给我以前的错误)

You can switch to the buffer and use Cc Ck to load the buffer, or just use Cc Cc to eval an expression. 您可以切换到缓冲区并使用Cc Ck加载缓冲区,或者仅使用Cc Cc评估表达式。 Another option would be: 另一种选择是:

(use :reload 'my.namespace)

in the REPL. 在REPL中。

Check out Stuart Sierra's tools for namespace management at the repl, and read the blog post where he explains how to use it effectively. 在repl上查看Stuart Sierra的名称空间管理工具 ,并阅读博客文章 ,其中解释了如何有效使用它。 With a little bit of coding discipline, you won't have to exit your nrepl anymore (or less, in any case). 有了一点编码纪律,您就不再需要退出nrepl(无论如何都可以退出)。 Good luck. 祝好运。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM