如何在 REPL 中重新加载 clojure 文件 [英] How to reload a clojure file in REPL

查看:35
本文介绍了如何在 REPL 中重新加载 clojure 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在无需重新启动 REPL 的情况下重新加载 Clojure 文件中定义的函数的首选方法是什么.现在,为了使用更新后的文件,我必须:

What is the preferred way of reloading functions defined in a Clojure file without having to restart the REPL. Right now, in order to use the updated file I have to:

  • 编辑src/foo/bar.clj
  • 关闭 REPL
  • 打开 REPL
  • (加载文件src/foo/bar.clj")
  • (使用'foo.bar)

此外,(use 'foo.bar :reload-all) 不会产生所需的效果,即评估修改后的函数体并返回新值,而不是作为源一点都没变.

In addition, (use 'foo.bar :reload-all) does not result in required effect, which is evaluating the modified bodies of functions and returning new values, instead of behaving as the source haven't changed at all.

文档:

推荐答案

(使用'your.namespace :reload)

这篇关于如何在 REPL 中重新加载 clojure 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆