Skip to content

Commit 99efac4

Browse files
committed
CLJS-2821: Update doto docstring to not use Java example
1 parent a0cadee commit 99efac4

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

src/main/clojure/cljs/core.cljc

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
(import-macros clojure.core
9494
[-> ->> .. assert comment cond
9595
declare defn-
96-
doto
9796
extend-protocol fn for
9897
if-let if-not letfn
9998
memfn
@@ -176,22 +175,21 @@
176175
"defs the supplied var names with no bindings, useful for making forward declarations."
177176
[& names] `(do ~@(map #(core/list 'def (vary-meta % assoc :declared true)) names))))
178177

179-
#?(:cljs
180-
(core/defmacro doto
181-
"Evaluates x then calls all of the methods and functions with the
182-
value of x supplied at the front of the given arguments. The forms
183-
are evaluated in order. Returns x.
178+
(core/defmacro doto
179+
"Evaluates x then calls all of the methods and functions with the
180+
value of x supplied at the front of the given arguments. The forms
181+
are evaluated in order. Returns x.
184182
185-
(doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"
186-
[x & forms]
187-
(core/let [gx (gensym)]
188-
`(let [~gx ~x]
189-
~@(map (core/fn [f]
190-
(if (seq? f)
191-
`(~(first f) ~gx ~@(next f))
192-
`(~f ~gx)))
193-
forms)
194-
~gx))))
183+
(doto (new js/Map) (.set \"a\" 1) (.set \"b\" 2))"
184+
[x & forms]
185+
(core/let [gx (gensym)]
186+
`(let [~gx ~x]
187+
~@(map (core/fn [f]
188+
(if (seq? f)
189+
`(~(first f) ~gx ~@(next f))
190+
`(~f ~gx)))
191+
forms)
192+
~gx)))
195193

196194
#?(:cljs
197195
(core/defn- parse-impls [specs]

0 commit comments

Comments
 (0)