Fork me on GitHub
#clojure-dev
<
2019-05-09
>
devn20:05:17

Well, that's almost certainly way oversimplified. The rabbit hole looks rather deep. Thoughts on approach welcome.

spinningtopsofdoom21:05:55

devn What is the rabbit hole that this patch leads to?

gfredericks22:05:23

I don't think making seq work on transients would be a viable solution

gfredericks22:05:44

only way to do that would be to make a full copy of the data structure, is my hasty guess

gfredericks22:05:15

(defn empty? [c] (zero? (count c))) works for transients

gfredericks22:05:46

I'm not sure that suggests any good implementation though; you wouldn't want to use that on lazy collections

gfredericks22:05:18

switching on whether it's a transient or not leads to the old "does it make normal things slower?" conundrum

gfredericks22:05:56

the most plausible thing I can imagine is rewriting empty? in terms of a new interface or protocol

gfredericks22:05:16

which sounds like at least moderately sized work