doc
함수 의 출력을 저장하려고했습니다 . 예 :
user> (def doc-str-split (doc str/split))
-------------------------
clojure.string/split
([s re] [s re limit])
Splits string on a regular expression. Optional argument limit is
the maximum number of splits. Not lazy. Returns vector of the splits.
#'user/doc-str-split
user> doc-str-split
nil
user>
그러나, 나는 가지고 nil
을 위해 doc-str-split
. 나는 얻으려고 노력 type
의 doc
출력 :
user> (type (doc str/split))
-------------------------
clojure.string/split
([s re] [s re limit])
Splits string on a regular expression. Optional argument limit is
the maximum number of splits. Not lazy. Returns vector of the splits.
nil
여전히 nil
. doc
함수 의 출력을 저장하는 방법은 무엇입니까?
다음 with-out-str
과 같이 출력을 캡처하는 데 사용할 수 있습니다 .
user> (def doc-str-split (with-out-str (doc str/split)))
#'user/doc-str-split
user> (println doc-str-split)
-------------------------
clojure.string/split
([s re] [s re limit])
Splits string on a regular expression. Optional argument limit is
the maximum number of splits. Not lazy. Returns vector of the splits.
nil
user> (type (with-out-str (doc str/split)))
java.lang.String
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다