<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged docstring</title>
<link>https://ask.clojure.org/index.php/tag/docstring</link>
<description></description>
<item>
<title>`find` docstring enhancement proposal</title>
<link>https://ask.clojure.org/index.php/14828/find-docstring-enhancement-proposal</link>
<description>&lt;p&gt;The &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/b4ea0f824b2eea039dfc06b796ed601e35cbeab6/src/clj/clojure/core.clj#L1550&quot;&gt;docstring&lt;/a&gt; for &lt;code&gt;clojure.core/find&lt;/code&gt; states&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Returns the map entry for key, or nil if key not present.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Formatted lower-cased with a space, it is not immediately apparent that 'map entry' is a term of art referring to a specific thing. 'map entry' might be mis-interpreted as a casual synonym for 'the entry of a map associated to a key', i.e., the value.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Proposal #1&lt;/strong&gt;&lt;br&gt;
Reword the &lt;code&gt;find&lt;/code&gt; docstring to be more precise about what is returned.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Returns a clojure.lang.MapEntry containing key and the associated value, or nil if key not present.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Proposal #2&lt;/strong&gt;&lt;br&gt;
If you don't want to make a &lt;a rel=&quot;nofollow&quot; href=&quot;https://groups.google.com/g/clojure/c/FVcrbHJpCW4/m/Fh7NsX_Yb7sJ&quot;&gt;commitment&lt;/a&gt; to returning a MapEntry, reword to&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Returns a sequential collection containing key and the associated value, or nil if key not present.&lt;/code&gt;&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14828/find-docstring-enhancement-proposal</guid>
<pubDate>Thu, 11 Dec 2025 12:41:48 +0000</pubDate>
</item>
<item>
<title>Docstring clojure.edn/read-string is misleading</title>
<link>https://ask.clojure.org/index.php/14762/docstring-clojure-edn-read-string-is-misleading</link>
<description>&lt;blockquote&gt;&lt;p&gt;  user=&amp;gt; (doc clojure.edn/read-string)&lt;br&gt;
  -------------------------&lt;br&gt;
  clojure.edn/read-string&lt;br&gt;
  ([s] [opts s])&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Reads one object from the string s. Returns nil when s is nil or empty.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;   Reads data in the edn format (subset of Clojure data):&lt;br&gt;
   &lt;a rel=&quot;nofollow&quot; href=&quot;http://edn-format.org&quot;&gt;http://edn-format.org&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;   opts is a map as per clojure.edn/read&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Note &lt;strong&gt;Returns nil when s is nil or empty.&lt;/strong&gt;. But when called with opts without explicit :eof it throws EOF error&lt;/p&gt;
&lt;p&gt;user=&amp;gt; (clojure.edn/read-string {} &quot;&quot;)&lt;br&gt;
Execution error at user/eval222 (REPL:1).&lt;br&gt;
EOF while reading&lt;/p&gt;
&lt;p&gt;And without options it returns nil as expected&lt;/p&gt;
&lt;p&gt;user=&amp;gt; (clojure.edn/read-string &quot;&quot;)&lt;br&gt;
nil&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14762/docstring-clojure-edn-read-string-is-misleading</guid>
<pubDate>Thu, 20 Nov 2025 15:10:38 +0000</pubDate>
</item>
<item>
<title>Support for automatic promotion to BigDecimal in +', *', etc.</title>
<link>https://ask.clojure.org/index.php/14752/support-for-automatic-promotion-to-bigdecimal-in-etc</link>
<description>&lt;p&gt;Is there support for BigDecimal promotion in the &lt;code&gt;+'&lt;/code&gt;, &lt;code&gt;*'&lt;/code&gt;, etc. &lt;code&gt;clojure.core&lt;/code&gt; functions?&lt;/p&gt;
&lt;p&gt;When I run the following code in the REPL:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(* 2 Double/MAX_VALUE)     ;; ##Inf, Doesn't auto-promote as was expected.
(*' 2 Double/MAX_VALUE)    ;; ##Inf, Expected that it would auto promote.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Following cases also didn't work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(*' Double/MAX_VALUE 2)        ;; ##Inf, Moving around the arguments.
(*' 2.0 Double/MAX_VALUE)      ;; ##Inf, Using a Double literal instead.
(*' Double/MAX_VALUE 2.0)      ;; ##Inf
(*' Double/MAX_VALUE 2.0M)     ;; ##Inf, Using a BigDecimal literal instead.
(*' 2.0M Double/MAX_VALUE)     ;; ##Inf
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I decided to check the Clojure compiler source for promotion, and based on my limited understanding of the code I see that &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/6a4ba6aedc8575768b2fff6d9c9c7e6503a0a93a/src/jvm/clojure/lang/Numbers.java#L634&quot;&gt;DoubleOps&lt;/a&gt; is using the implementation of &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/6a4ba6aedc8575768b2fff6d9c9c7e6503a0a93a/src/jvm/clojure/lang/Numbers.java#L76&quot;&gt;addP&lt;/a&gt; of &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/6a4ba6aedc8575768b2fff6d9c9c7e6503a0a93a/src/jvm/clojure/lang/Numbers.java#L75&quot;&gt;OpsP&lt;/a&gt; abstract class (which just calls the normal &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/6a4ba6aedc8575768b2fff6d9c9c7e6503a0a93a/src/jvm/clojure/lang/Numbers.java#L671&quot;&gt;add&lt;/a&gt; function)  while there is one present for &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/6a4ba6aedc8575768b2fff6d9c9c7e6503a0a93a/src/jvm/clojure/lang/Numbers.java#L449&quot;&gt;LongOps&lt;/a&gt; which can be found &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/6a4ba6aedc8575768b2fff6d9c9c7e6503a0a93a/src/jvm/clojure/lang/Numbers.java#L494&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Is this a bug? And if yes, I would like to work on the fix and I'll check the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/dev/dev&quot;&gt;Development&lt;/a&gt; page of Clojure to do the needfull.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14752/support-for-automatic-promotion-to-bigdecimal-in-etc</guid>
<pubDate>Mon, 10 Nov 2025 04:15:47 +0000</pubDate>
</item>
<item>
<title>Typo in clojure.zipper/zipper docstring</title>
<link>https://ask.clojure.org/index.php/14733/typo-in-clojure-zipper-zipper-docstring</link>
<description>&lt;p&gt;The docstring for &lt;code&gt;clojure.zipper/zipper&lt;/code&gt; currently contains:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;branch? is a fn that, given a node, returns true if can have&lt;br&gt;
children, even if it currently doesn't.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;which should be:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;branch? is a fn that, given a node, returns true if it can have&lt;br&gt;
children, even if it currently doesn't.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14733/typo-in-clojure-zipper-zipper-docstring</guid>
<pubDate>Mon, 27 Oct 2025 09:30:17 +0000</pubDate>
</item>
<item>
<title>The docstring on empty? should perhaps not recommend using seq instead anymore</title>
<link>https://ask.clojure.org/index.php/14724/docstring-empty-should-perhaps-recommend-instead-anymore</link>
<description>&lt;p&gt;It seems the docstring on &lt;code&gt;empty?&lt;/code&gt; is outdated, recommending to use &lt;code&gt;seq&lt;/code&gt; to check for emptiness, even though nowodays empty? may be much faster (on counted collections):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn empty?
  &quot;Returns true if coll has no items. To check the emptiness of a seq,
  please use the idiom (seq x) rather than (not (empty? x))&quot;
  {:added &quot;1.0&quot;
   :static true}
  [coll]
  (if (counted? coll)
    (zero? (count coll))
    (not (seq coll))))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14724/docstring-empty-should-perhaps-recommend-instead-anymore</guid>
<pubDate>Fri, 17 Oct 2025 11:55:12 +0000</pubDate>
</item>
<item>
<title>&quot;:added&quot; metadata missing from some new public functions in namespace clojure.java.process</title>
<link>https://ask.clojure.org/index.php/14504/metadata-missing-public-functions-namespace-clojure-process</link>
<description>&lt;p&gt;These functions in the namespace clojure.java.process are mentioned in the doc string for the namespace, and have doc strings, but do not have metadata &lt;code&gt;{:added &quot;1.12&quot;}&lt;/code&gt; as do other new public docstring'ed functions in that namespace:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;stdin&lt;/li&gt;
&lt;li&gt;stdout&lt;/li&gt;
&lt;li&gt;stderr&lt;/li&gt;
&lt;li&gt;exit-ref&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I did not find any other such functions anywhere else that are new in Clojure 1.12.0 vs. Clojure 1.11.1.&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14504/metadata-missing-public-functions-namespace-clojure-process</guid>
<pubDate>Fri, 11 Apr 2025 16:29:23 +0000</pubDate>
</item>
<item>
<title>Docstring typos in clojure.core/bytes, chars, shorts</title>
<link>https://ask.clojure.org/index.php/14447/docstring-typos-in-clojure-core-bytes-chars-shorts</link>
<description>&lt;p&gt;The docstring of &lt;code&gt;clojure.core/bytes&lt;/code&gt; has a minor typo:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;  &quot;Casts to bytes[]&quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;which should read &lt;code&gt;byte[]&lt;/code&gt;; similarly for the docstrings of &lt;code&gt;chars&lt;/code&gt; and &lt;code&gt;shorts&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;Given the new array class syntax in Clojure 1.12 perhaps these should be updated to read &lt;code&gt;byte/1&lt;/code&gt;,  &lt;code&gt;float/1&lt;/code&gt; etc. instead of using Java style syntax? &lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14447/docstring-typos-in-clojure-core-bytes-chars-shorts</guid>
<pubDate>Thu, 06 Mar 2025 06:54:53 +0000</pubDate>
</item>
<item>
<title>Incorrect docstring for parse-opts</title>
<link>https://ask.clojure.org/index.php/14275/incorrect-docstring-for-parse-opts</link>
<description>&lt;p&gt;In the docstring for &lt;code&gt;clojure.tools.cli/parse-opts&lt;/code&gt; (seen &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.github.io/tools.cli/#clojure.tools.cli/parse-opts&quot;&gt;here&lt;/a&gt;), it says,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:id           The key for this option in the resulting option map. This
              is normally set to the keywordized name of the long option
              without the leading dashes.

              Multiple option entries can share the same :id in order to
              transform a value in different ways, but only one of these
              option entries may contain a :default(-fn) entry.

              This option is mandatory.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The final line says &quot;This option is mandatory.&quot; which is technically true for parse-opts' internals, but it's not true for users because (as the first paragraph says) &lt;code&gt;:id&lt;/code&gt; is also generated by keywordizing the long option.&lt;/p&gt;
&lt;p&gt;May I recommend changing it to be more explicit? Something like &quot;If a long option is not provided, this option is mandatory.&quot;&lt;/p&gt;
</description>
<category>tools.cli</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14275/incorrect-docstring-for-parse-opts</guid>
<pubDate>Tue, 03 Dec 2024 16:02:27 +0000</pubDate>
</item>
<item>
<title>Missing documentation for `:while` modifier of `for` and `doseq`</title>
<link>https://ask.clojure.org/index.php/14002/missing-documentation-for-while-modifier-of-for-and-doseq</link>
<description>&lt;p&gt;I believe the &lt;code&gt;for&lt;/code&gt; and &lt;code&gt;doseq&lt;/code&gt; documentation (at least docstrings) fail to explain the semantics of the &lt;code&gt;:while&lt;/code&gt; modifier. The existence is documented, but not the behavior.&lt;/p&gt;
&lt;p&gt;I would like to request that the doctoring be updated, especially since it behaves in what I believe is a reasonable but counter-intuitive way. I believe a reasonable person would expect that &lt;code&gt;:while false&lt;/code&gt; would trigger the &lt;code&gt;for&lt;/code&gt; or &lt;code&gt;doseq&lt;/code&gt; to exit; however it does not. Rather it causes the inner-most loop containing the &lt;code&gt;:while&lt;/code&gt; to exit, but most notably the outer loops continue to iterate.&lt;/p&gt;
&lt;p&gt;Another discussion of this can be found here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C053AK3F9/p1719593304442819&quot;&gt;clojurians&lt;/a&gt;&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14002/missing-documentation-for-while-modifier-of-for-and-doseq</guid>
<pubDate>Mon, 01 Jul 2024 13:56:08 +0000</pubDate>
</item>
<item>
<title>Clarify how to implement multi-arity methods with defprotocol</title>
<link>https://ask.clojure.org/index.php/13929/clarify-how-implement-multi-arity-methods-with-defprotocol</link>
<description>&lt;p&gt;Hello! I have struggled to understand how to implement a multi-arity protocol method with a record, so I’d like to suggest an improvement to the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/3eab1a5a5b4cfed86c1d0c9c21bd1892e1fb44fd/src/clj/clojure/core_deftype.clj#L344-L348&quot;&gt;defrecord docstring&lt;/a&gt; to make this clearer. I am thinking about this change (new is the last paragraph):&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;(methodname [args*] body)&lt;/p&gt;
&lt;p&gt;The argument and return types can be hinted on the arg and&lt;br&gt;
  methodname symbols. If not supplied, they will be inferred, so type&lt;br&gt;
  hints should be reserved for disambiguation.&lt;/p&gt;
&lt;p&gt; For multi-arity methods, add a separate (methodname ...) entry&lt;br&gt;
  for each one.*&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13929/clarify-how-implement-multi-arity-methods-with-defprotocol</guid>
<pubDate>Wed, 29 May 2024 17:15:02 +0000</pubDate>
</item>
<item>
<title>clojuredoc sort is wrong with respect to comparator</title>
<link>https://ask.clojure.org/index.php/13822/clojuredoc-sort-is-wrong-with-respect-to-comparator</link>
<description>&lt;p&gt;The clojuredoc for sort says:&lt;br&gt;
&lt;code&gt;comparator MUST implement java.util.Comparator.&lt;/code&gt;&lt;br&gt;
However, this does not seem to be the case.  The function provided as 1nd argument to 2-ary &lt;code&gt;sort&lt;/code&gt; may return explicitly &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;; it need not implement &lt;code&gt;java.util.Comparator&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It would be nice if the clojuredoc were updated to reflect this important feature.&lt;/p&gt;
&lt;p&gt;There is another document &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.org/guides/comparators&quot;&gt;https://clojure.org/guides/comparators&lt;/a&gt; which explains in greater detail.  But the existence of that document does not obviate (in my opinion) the short doc from being correct even if incomplete.&lt;/p&gt;
</description>
<category>Clojure</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13822/clojuredoc-sort-is-wrong-with-respect-to-comparator</guid>
<pubDate>Fri, 19 Apr 2024 09:51:42 +0000</pubDate>
</item>
<item>
<title>cljs.core/test does not work as the docstring describes</title>
<link>https://ask.clojure.org/index.php/13756/cljs-core-test-does-not-work-as-the-docstring-describes</link>
<description>&lt;p&gt;&lt;code&gt;cljs.core/test&lt;/code&gt; does not work according to its docstring description.&lt;/p&gt;
&lt;p&gt;The definition of cljs.core/test is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn test
  &quot;test [v] finds fn at key :test in var metadata and calls it,
  presuming failure will throw exception&quot;
  [v]
  (let [f (.-cljs$lang$test v)]
    (if f
      (do (f) :ok)
      :no-test)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It's intended use, as far as I understand it, is as such (example copied from the documented Clojure version of the same function at ClojureDocs, &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/test#example-542692cac026201cdc326b8a&quot;&gt;https://clojuredocs.org/clojure.core/test#example-542692cac026201cdc326b8a&lt;/a&gt; ):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn my-function
  &quot;this function adds two numbers&quot;
  {:test #(do
            (assert (= (my-function 2 3) 5))
            (assert (= (my-function 4 4) 8)))}
  ([x y] (+ x y)))

(test #'my-function)  ;equal to (test (var my-function))
=&amp;gt; :ok
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, &lt;code&gt;cljs.core/test&lt;/code&gt; enables functions to self-document their capabilities via tests made available in metadata under the &lt;code&gt;:test&lt;/code&gt; key.&lt;/p&gt;
&lt;p&gt;However, repeating the above in a CLJS environment yields a different result:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn my-function
  &quot;this function adds two numbers&quot;
  {:test #(do
            (assert (= (my-function 2 3) 5))
            (assert (= (my-function 4 4) 8)))}
  ([x y] (+ x y)))

(test #'my-function)
=&amp;gt; :no-test
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The interesting thing is that, given that I evalated the above in a CLJS REPL, the metadata &lt;em&gt;is&lt;/em&gt; available, as far as I can tell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(meta #'my-function)
=&amp;gt;
{:ns cljs.user,
 :name my-function,
 :file &quot;&amp;lt;cljs repl&amp;gt;&quot;,
 :end-column 18,
 :source &quot;my-function&quot;,
 :column 1,
 :line 1,
 :end-line 1,
 :arglists ([x y]),
 :doc &quot;this function adds two numbers&quot;, 
 :test #object[Function]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This can be made even clearer by substituting the rather opaque function for a keyword:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn my-function
  &quot;this function adds two numbers&quot;
  {:test :just-a-keyword}
  ([x y] (+ x y)))

(meta #'my-function)
=&amp;gt;
{:ns cljs.user,
 :name my-function,
 :file &quot;&amp;lt;cljs repl&amp;gt;&quot;,
 :end-column 18,
 :source &quot;my-function&quot;,
 :column 1,
 :line 1,
 :end-line 1,
 :arglists ([x y]),
 :doc &quot;this function adds two numbers&quot;, 
 :test :just-a-keyword}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I spoke to @theller and @hiredman about this on the Clojurians Slack, and they speculated that &lt;code&gt;cljs.core/test&lt;/code&gt; has been repurposed to execute the body of &lt;code&gt;deftest&lt;/code&gt;s, since the two pieces seem to fit together. Observe:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[cljs.test :as test])
(test/deftest foo (test/is (= 1 2)))
=&amp;gt; #'cljs.user/foo

(test foo)
FAIL in () (&amp;lt;NO_SOURCE_FILE&amp;gt;:1:28)
expected: (= 1 2)
  actual: (not (= 1 2))

:ok
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;deftest&lt;/code&gt; body is executed and the keyword &lt;code&gt;:ok&lt;/code&gt; is returned (regardless of the &lt;code&gt;is&lt;/code&gt; result), as can also be gathered from reading definition of &lt;code&gt;cljs.core/test&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If it is true that &lt;code&gt;cljs.core/test&lt;/code&gt; has been repurposed in this manner, then two things are also true:&lt;/p&gt;
&lt;p&gt;A) If it ever were the intent that &lt;code&gt;cljs.core/test&lt;/code&gt; should enable testing &lt;code&gt;:test&lt;/code&gt; assertions for &lt;code&gt;defn&lt;/code&gt;s, that no longer holds.&lt;br&gt;
B) The docstring of &lt;code&gt;cljs.core/test&lt;/code&gt; is somewhat misleading.&lt;/p&gt;
&lt;p&gt;The first bit of the docstring, &lt;code&gt;&quot;test [v] finds fn at key :test in var metadata and calls it&quot;&lt;/code&gt;, may be technically correct, but mentions no connection with &lt;code&gt;deftest&lt;/code&gt;, and therefore somewhat unhelpful. &lt;/p&gt;
&lt;p&gt;The second bit of the docstring, &lt;code&gt;&quot;, presuming failure will throw exception&lt;/code&gt;&quot;, is certainly not correct when used for &lt;code&gt;deftest&lt;/code&gt; - the &lt;code&gt;cljs.test/is&lt;/code&gt; macro, which I think is fair to say that most &lt;code&gt;deftest&lt;/code&gt;s use, catches exceptions and reports instead. I think the original intent is that the execption is thrown, so &lt;code&gt;:ok&lt;/code&gt; is not returned, but in this context, that construct fails.&lt;/p&gt;
&lt;p&gt;The docstring seems to be a carbon copy of the Clojure version, so possibly, it warrants an update. Or maybe &lt;code&gt;cljs.core/test&lt;/code&gt; is simply unused and redundant at this point?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13756/cljs-core-test-does-not-work-as-the-docstring-describes</guid>
<pubDate>Tue, 27 Feb 2024 12:33:17 +0000</pubDate>
</item>
<item>
<title>Does `:exclude` need to be added to https://clojuredocs.org/clojure.core/require ?</title>
<link>https://ask.clojure.org/index.php/13714/does-exclude-need-added-https-clojuredocs-clojure-require</link>
<description>&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/require&quot;&gt;https://clojuredocs.org/clojure.core/require&lt;/a&gt; makes no mention of &lt;code&gt;:exclude&lt;/code&gt; but this seems to work as it appears:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[clojure.set :refer :all :exclude [join rename]])
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13714/does-exclude-need-added-https-clojuredocs-clojure-require</guid>
<pubDate>Tue, 13 Feb 2024 19:29:06 +0000</pubDate>
</item>
<item>
<title>Dedupe doesn't mention statefullness in docstring</title>
<link>https://ask.clojure.org/index.php/13636/dedupe-doesnt-mention-statefullness-in-docstring</link>
<description>&lt;p&gt;Unlike all other core functions which can return a stateful transducer, &lt;code&gt;dedupe&lt;/code&gt; doesn't mention this in its docstring. E.g. &lt;code&gt;distinct&lt;/code&gt;, &lt;code&gt;drop-while&lt;/code&gt; etc. all say:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Returns a stateful transducer when no collection is provided.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But &lt;code&gt;dedupe&lt;/code&gt; just says:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Returns a transducer when no collection is provided.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13636/dedupe-doesnt-mention-statefullness-in-docstring</guid>
<pubDate>Mon, 22 Jan 2024 12:22:44 +0000</pubDate>
</item>
<item>
<title>clojure.math/scalb docstring error</title>
<link>https://ask.clojure.org/index.php/13458/clojure-math-scalb-docstring-error</link>
<description>&lt;p&gt;The docstring for &lt;code&gt;scalb&lt;/code&gt; links to the documentation for &lt;code&gt;nextDown&lt;/code&gt;, presumably just a mistake.&lt;/p&gt;
&lt;p&gt;It links here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextDown-double-&quot;&gt;https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#nextDown-double-&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But should link here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#scalb-double-int-&quot;&gt;https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#scalb-double-int-&lt;/a&gt;&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13458/clojure-math-scalb-docstring-error</guid>
<pubDate>Sat, 11 Nov 2023 13:08:46 +0000</pubDate>
</item>
<item>
<title>clojure.math/floor docstring error</title>
<link>https://ask.clojure.org/index.php/13417/clojure-math-floor-docstring-error</link>
<description>&lt;p&gt;In the docstring for &lt;code&gt;clojure.math/floor&lt;/code&gt; it says:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;If a is less than zero but greater than -1.0 =&amp;gt; -0.0&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;but that's obviously not true:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(math/floor -0.3)
;; =&amp;gt; -1.0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I guess it was intended to add that line to the docstring of &lt;code&gt;clojure.math/ceil&lt;/code&gt; but added it to floor by mistake?&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13417/clojure-math-floor-docstring-error</guid>
<pubDate>Mon, 30 Oct 2023 12:55:24 +0000</pubDate>
</item>
<item>
<title>Typo in build.memoizer docstring</title>
<link>https://ask.clojure.org/index.php/13120/typo-in-build-memoizer-docstring</link>
<description>&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/core.memoize/blob/master/src/main/clojure/clojure/core/memoize.clj#L267&quot;&gt;https://github.com/clojure/core.memoize/blob/master/src/main/clojure/clojure/core/memoize.clj#L267&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;argunments -&amp;gt; arguments&lt;/p&gt;
</description>
<category>core.memoize</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13120/typo-in-build-memoizer-docstring</guid>
<pubDate>Mon, 31 Jul 2023 13:33:11 +0000</pubDate>
</item>
<item>
<title>Document that clojure.data.int-map is sorted</title>
<link>https://ask.clojure.org/index.php/12778/document-that-clojure-data-int-map-is-sorted</link>
<description>&lt;p&gt;Recently a question about it &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1KBA2/p1679007293266749&quot;&gt;was asked on Slack&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/DIMAP-4&quot;&gt;DIMAP-4 Jira ticket&lt;/a&gt; has made the map and the set deliberately sorted, but it was never mentioned in the docs.&lt;br&gt;
Seems like it could be explicitly mentioned in the docstrings?&lt;/p&gt;
</description>
<category>data.int-map</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12778/document-that-clojure-data-int-map-is-sorted</guid>
<pubDate>Fri, 17 Mar 2023 08:58:14 +0000</pubDate>
</item>
<item>
<title>Docstring of with-redefs should mention usage of ^:dynamic in production</title>
<link>https://ask.clojure.org/index.php/12766/docstring-redefs-should-mention-usage-dynamic-production</link>
<description>&lt;p&gt;Currently, the docstring of &lt;code&gt;with-redefs&lt;/code&gt; in CLJS reads:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.core/with-redefs
([bindings &amp;amp; body])
Macro
  binding =&amp;gt; var-symbol temp-value-expr

  Temporarily redefines vars while executing the body.  The
  temp-value-exprs will be evaluated and each resulting value will
  replace in parallel the root value of its var.  After the body is
  executed, the root values of all the vars will be set back to their
  old values. Useful for mocking out functions during testing.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It makes it seem as if it's perfectly fine to use it in a similar way you'd use the same macro in CLJ.&lt;br&gt;
However, &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJS-1623?focusedCommentId=46238&quot;&gt;this comment&lt;/a&gt; by David Nolen says otherwise: &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;If you want something to be redefinable with &lt;code&gt;with-redefs&lt;/code&gt; in production you need to mark those vars ^:dynamic.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12766/docstring-redefs-should-mention-usage-dynamic-production</guid>
<pubDate>Tue, 14 Mar 2023 13:11:08 +0000</pubDate>
</item>
<item>
<title>The `keyword` and `symbol` docstrings don't mention that using `&quot;a/b&quot;` as its only argument is valid</title>
<link>https://ask.clojure.org/index.php/12657/keyword-symbol-docstrings-mention-that-using-argument-valid</link>
<description>&lt;p&gt;The current docstrings:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clojure.core/keyword
([name] [ns name])
  Returns a Keyword with the given namespace and name.  Do not use :
  in the keyword strings, it will be added automatically.

clojure.core/symbol
([name] [ns name])
  Returns a Symbol with the given namespace and name. Arity-1 works
  on strings, keywords, and vars.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The arglists suggest that the first arity is to be used for simple idents only.&lt;br&gt;
However, the underlying implementation explicitly handles the case when there's &lt;code&gt;/&lt;/code&gt; in the value, and even the argument is named &lt;code&gt;nsname&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static public Symbol intern(String nsname){
	int i = nsname.indexOf('/');
	if(i == -1 || nsname.equals(&quot;/&quot;))
		return new Symbol(null, nsname);
	else
		return new Symbol(nsname.substring(0, i), nsname.substring(i + 1));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One example where some existing code relies on this behavior: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/cognitect/transit-clj/blob/972759aed878d354fbd65de3e4525345955e86b4/src/cognitect/transit.clj#L205-L207&quot;&gt;transit-clj&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Perhaps, the docstrings should be updated to reflect that?&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12657/keyword-symbol-docstrings-mention-that-using-argument-valid</guid>
<pubDate>Wed, 08 Feb 2023 16:53:38 +0000</pubDate>
</item>
<item>
<title>Documentation for `rationalize` is misleading</title>
<link>https://ask.clojure.org/index.php/11717/documentation-for-rationalize-is-misleading</link>
<description>&lt;p&gt;It says&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;returns the rational value of num&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;but the results of &lt;code&gt;(rationalize 1.6)&lt;/code&gt; is &lt;code&gt;8/5&lt;/code&gt; instead of expected &lt;code&gt;3602879701896397/2251799813685248&lt;/code&gt;. What kind of rounding is performed isn't documented.&lt;/p&gt;
</description>
<category>Docs</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11717/documentation-for-rationalize-is-misleading</guid>
<pubDate>Sat, 02 Apr 2022 15:15:17 +0000</pubDate>
</item>
</channel>
</rss>