Skip to content

Commit 044930b

Browse files
frenchy64stuarthalloway
authored andcommitted
Implement Iterable in clojure.core/bean.
Signed-off-by: Stuart Halloway <[email protected]>
1 parent 4c963fb commit 044930b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/clj/clojure/core_proxy.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@
392392
{} (seq pmap)))]
393393
(proxy [clojure.lang.APersistentMap]
394394
[]
395+
(iterator [] (.iterator ^Iterable pmap))
395396
(containsKey [k] (contains? pmap k))
396397
(entryAt [k] (when (contains? pmap k) (new clojure.lang.MapEntry k (v k))))
397398
(valAt ([k] (when (contains? pmap k) (v k)))

test/clojure/test_clojure/java_interop.clj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@
143143

144144
(:class b) java.awt.Color )))
145145

146+
(deftest test-iterable-bean
147+
(is (.iterator ^Iterable (bean (java.util.Date.))))
148+
(is (hash (bean (java.util.Date.)))))
146149

147150
; proxy, proxy-super
148151

0 commit comments

Comments
 (0)