在 REPL 中重新加载命名空间时出现 IllegalStateException
我的命名空间声明如下所示:
(ns test.foo
(:use
[clj-http.client :only (get) :as client]
[net.cgrand.enlive-html :only (select) :as html]))
我第一次使用它时,它在 REPL 中运行良好。然后,当我修改代码并在 REPL 中尝试以下操作时:
(use :reload 'test.foo)
我得到:
java.lang.IllegalStateException: get already refers to: #'clj-http.client/get in namespace: test.foo (foo.clj:1)
我在逆时针方向的 Windows 上,并且还尝试了 leiningen (lein repl)。
My namespace declaration looks like this:
(ns test.foo
(:use
[clj-http.client :only (get) :as client]
[net.cgrand.enlive-html :only (select) :as html]))
It works fine in the REPL, the first time I use it. Then, when I modify the code and try the following in the REPL:
(use :reload 'test.foo)
I get:
java.lang.IllegalStateException: get already refers to: #'clj-http.client/get in namespace: test.foo (foo.clj:1)
I'm on windows with counterclockwise and also tried with leiningen (lein repl).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应该意外地隐藏核心 fns。您必须明确表达您的意图:
You should not shadow core fns by accident. You have to be explicit about your intent: