Welcome! Please see the About page for a little more info on how this works.

+1 vote
in ClojureScript by

Like CLJ-1872 but for ClojureScript. (Note that CLJ-1872 is vetted, targeting Clojure 1.10.)

ClojureScript 1.10.339 cljs.user=> (empty? (transient [])) ... Error: [object Object] is not ISeqable ... cljs.user=> (empty? (transient {})) ... Error: [object Object] is not ISeqable ... cljs.user=> (empty? (transient #{})) ... Error: [object Object] is not ISeqable ... cljs.user=>

5 Answers

0 votes
by
_Comment made by: mfikes_

Adds an additional check for {{ITransientCollection}} in {{empty?}} implementation and delegates to {{count}}, which should be O(1).

It may be worth waiting to see if CLJ-1872 actually ships in Clojure before applying. (This would also afford an opportunity to make the docstring match Clojure's.)
0 votes
by

Comment made by: mfikes

CLJS-2802-2.patch rebaselines

0 votes
by

Comment made by: mfikes

CLJS-2802-2.patch added to Patch Tender (i)

0 votes
by

Comment made by: dnolen

Lowering the priority on this as the verdict for the same change in Clojure is uncertain.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2802 (reported by mfikes)
...