请在 2024 Clojure 状态调查 中分享您的想法!

欢迎!请查看 关于 页面以获取更多关于此如何运作的信息。

0
工具

使用基于 deps.edn 的最小化项目

(! 1105)-> clojure -Tnew lib :name repro/help-doc
Generating a project called help-doc based on the 'app' template.
(! 1106)-> cd help-doc/
(! 1107)-> cat src/repro/help_doc.clj 
(ns repro.help-doc
  (:gen-class))

(defn greet
  "Callable entry point to the application."
  [data]
  (println (str "Hello, " (or (:name data) "World") "!")))

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (greet {:name (first args)}))
(! 1108)-> clojure -X:deps help/doc :ns repro.help-doc
-------------------------
repro.help-doc/-main
([& args])
  I don't do a whole lot ... yet.
-------------------------
repro.help-doc/greet
([data])
  Callable entry point to the application.
(! 1109)-> clojure -X:deps help/doc :fn repro.help-doc/greet
-------------------------

(! 1110)-> cat deps.edn
{:paths ["src" "resources"]
 :deps {org.clojure/clojure {:mvn/version "1.10.3"}}}

这两者都不起作用

(! 1111)-> clojure -X:deps help/doc :ns repro.help-doc :fn greet
-------------------------

(! 1112)-> clojure -X:deps help/doc :ns-default repro.help-doc :fn greet
-------------------------

1 个答案

+1

被选中
 
最佳答案

引用函数文档的正确方式似乎应该是 -X:deps help/doc :fn <ns-name>/<fn-name>

$ clj -X:deps help/doc :fn clojure.core/cons
-------------------------
clojure.core/cons
([x seq])
  Returns a new seq where x is the first element and seq is
    the rest.

$

但在这个情况下,这仍然不起作用。可能在此行中的 resolve 调用应该是 requiring-resolve 吗?

是,已经在1.10.3.912中修复。
by
感谢快速的修复!
...