Comment made by: devn
First things first, the original description brings up (empty? (transient ()))
. Per the documentation at https://clojure.org/reference/transients, there is no benefit to be had for supporting transients on lists.
Current behavior for java collections:
`
(empty? (java.util.HashMap. {}))
=> true
(empty? (java.util.HashMap. {1 2}))
=> false
(seq (java.util.HashMap. {1 2}))
=> (#object[java.util.HashMap$Node 0x4335c9c3 "1=2"])
(seq (java.util.HashMap. {}))
=> nil
`
The same behavior is true of java arrays.
Over in CLJS-2802, the current patch's approach is to cond
around the problem in empty?
by explicitly checking whether it's a TransientCollection, and if so, using (zero? (count coll))
as the original description mentions as a workaround.
Currently, transient collections do not implement Iterable as the persistent ones do. If Iterable were implemented, I believe RT.seqFrom would work, and by extension, empty?
.