你能解释一下吗?我不明白,为什么具有点特殊形式和恒等函数的几乎相同的代码却有不同的结果?
(. System getProperties) # => {"key" ...}
(. (clojure.core/identity System) getProperties) # => (err) No matching field found: getProperties for class java.lang.Class
Run Code Online (Sandbox Code Playgroud)
我尝试比较一下:
(= (clojure.core/identity System) System) # true
Run Code Online (Sandbox Code Playgroud)
结果是真的
我需要命名空间,我可以使用它:
(ns core
(:require [hello :as h]))
(println h/x)
Run Code Online (Sandbox Code Playgroud)
但为什么我不能只打印名称空间?
(println h) # Unable to resolve symbol: h in this context
Run Code Online (Sandbox Code Playgroud)
我用 deps-tools 和 leiningen 尝试过这个
clojure ×2