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.

$

但在这个例子中,它仍然不起作用。很可能是这个调用此行应该是 requiring-resolve

是的,已在1.10.3.912中修复。
感谢您迅速修复!
...