以下代码失败(在 1.6 和最新 1.7-alpha4 下都失败)
`
user=> (ns foo)
nil
foo=> (def inc inc)
WARNING: inc already refers to: #'clojure.core/inc in namespace: foo, being replaced by: #'foo/inc
'foo/inc
;; 注意此时 inc 未绑定,这导致以下异常
foo=> inc
foo=> (ns bar)
nil
bar=> (require ['foo :refer ['inc]])
WARNING: inc already refers to: #'clojure.core/inc in namespace: bar, being replaced by: #'foo/inc
nil
bar=> (inc 8)
IllegalStateException Attempting to call unbound fn: #'foo/inc clojure.lang.Var$Unbound.throwArity (Var.java:43)
`
进一步的调查显示 foo/inc 未绑定
foo/inc
=> #
进一步的调查还显示,将 (def inc inc) 替换为任何其他几乎任何内容,例如 (def inc dec),(def inc clojure.core/inc) 或 (def inc (fn (link: n) (+ n 1))) 不会引发异常(但警告仍然存在)。
我期望
a) foo/inc 应当被绑定,并且其值应与 clojure.core/inc 相同
b) 在 require foo/inc 时没有错误
c) bar/inc 应当绑定到 foo/inc