Skip to content

Commit 51d0c55

Browse files
frenchy64puredanger
authored andcommitted
CLJ-2552: Fix example code and improve recur description in reify docstring
1 parent dbaa189 commit 51d0c55

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/clj/clojure/core_deftype.clj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,19 @@
101101
same arity in an interface you must specify complete hints to
102102
disambiguate - a missing hint implies Object.
103103
104-
recur works to method heads The method bodies of reify are lexical
105-
closures, and can refer to the surrounding local scope:
104+
Method heads are recursion points for recur, as in a fn. The method
105+
bodies of reify are lexical closures, and can refer to the surrounding
106+
local scope:
106107
107108
(str (let [f \"foo\"]
108-
(reify Object
109-
(toString [this] f))))
109+
(reify Object
110+
(toString [this] f))))
110111
== \"foo\"
111112
112113
(seq (let [f \"foo\"]
113-
(reify clojure.lang.Seqable
114-
(seq [this] (seq f)))))
115-
== (\\f \\o \\o))
114+
(reify clojure.lang.Seqable
115+
(seq [this] (seq f)))))
116+
== (\\f \\o \\o)
116117
117118
reify always implements clojure.lang.IObj and transfers meta
118119
data of the form to the created object.

0 commit comments

Comments
 (0)