我正在将工作 Clojure 代码(在 Leiningen 项目中)从 1.2 移植到 1.3 并遇到问题。除了代码本身不再工作之外,我还收到了几十条这样的警告消息:
Warning: *tooltip-width* not declared dynamic and thus is not dynamically rebindable,
but its name suggests otherwise. Please either indicate ^:dynamic *tooltip-width*
or change the name.
即使我已经对用于维护状态的 var 进行了正确的修改,这种情况仍在发生。例如,对于上面的错误,代码已经包含了这个:
(def ^:dyanamic *tooltip-width* (* 1.8 *slip-width*))
我在两个地方得到这些错误:首先,从命令行,作为执行的结果lein swank
;其次,来自 Emacs REPL,在core.clj
使用C-c C-w
.
为了绝对完整,这是我的project.clj
文件:
(defproject infwb "1.0.0-SNAPSHOT"
:description "an evolving, experimental workspace for manipulating infocards"
:main infwb.core
:dependencies [[org.clojure/clojure "1.3"]
[seesaw "1.2.1"]
[org.clojars.gw666/sxqj "beta2"]
[org.clojars.gw666/piccolo2dcore "1.3"]
[org.clojars.gw666/piccolo2dextras "1.3"]
[com.miglayout/miglayout "3.7.4"]
]
:dev-dependencies [[swank-clojure "1.3.2"]
[org.clojars.weavejester/autodoc "0.9.0"]]
:autodoc {:name "Infocard Workbench (InfWb)",
:web-src-dir "https://github.com/gw666/infwb/blob"})
除了让我的代码正常工作之外,我还想了解为什么会出现这些错误以及为什么会在这两个地方都出现这些错误。谢谢你的帮助。