2024年Clojure状态调查!(State of Clojure Survey!)中分享您的想法。

欢迎!请参阅关于页面,了解有关如何操作的更多信息。

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

Sean Corfield选中
 
最佳答案

引用函数文档的正确方式似乎应该是-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中已修复。
感谢您快速的修复!
...