我试图从自定义命名空间中选择refer和qualify基本核心函数,但没有成功:
cplay.core> (refer 'clojure.core)
nil
cplay.core> (clojure.core/refer 'clojure.core)
nil
cplay.core> (doc memoize)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: doc in this context, compiling:(/private/var/folders/0h/lzx021jx1rl95vhfxmcppmlc0000gn/T/form-init7998067657898575130.clj:1:1)
cplay.core> (clojure.core/doc memoize)
CompilerException java.lang.RuntimeException: No such var: clojure.core/doc, compiling:(/private/var/folders/0h/lzx021jx1rl95vhfxmcppmlc0000gn/T/form-init7998067657898575130.clj:1:1) 我敢肯定这里有一些很简单的事情,有人能给我建议吗?
发布于 2014-01-21 06:51:24
您应该使用refer clojure.repl来使用doc宏。
user=> (ns xxx)
nil
xxx=> (clojure.repl/doc memoize)
-------------------------
clojure.core/memoize
([f])
Returns a memoized version of a referentially transparent function. The
memoized version of the function keeps a cache of the mapping from arguments
to results and, when calls with the same arguments are repeated often, has
higher performance at the expense of higher memory use.
nil
xxx=> (refer 'clojure.repl)
nil
xxx=> (doc memoize)
-------------------------
clojure.core/memoize
([f])
Returns a memoized version of a referentially transparent function. The
memoized version of the function keeps a cache of the mapping from arguments
to results and, when calls with the same arguments are repeated often, has
higher performance at the expense of higher memory use.
nil发布于 2014-01-21 07:32:19
首先(use clojure.repl),然后尝试(doc memoize)
https://stackoverflow.com/questions/21251029
复制相似问题