41 ms·
I'm not sure what you mean. Clojure's abstractions (seqs and maps) are completely compatible with Java collections and require no conversion in either direction
by pron 13y ago
I'm not sure what you mean. Clojure's abstractions (seqs and maps) are completely compatible with Java collections and require no conversion in either direction, while Scala collections do.
- felipehummel 13y agoYou can actually make it automatically convert in both directions with just an import. But it is good practice to do it explicitly. In my opinion, for a typesafe language, this is a good way to do it.
- pron 13y agoThe conversion, either implicit or explicit, is not free, neither in terms of performance, nor in terms of mental effort. This is not the case with Groovy, Kotlin and Clojure (though Java interoperability in Clojure does require more mental effort than in Groovy and Kotlin).
- eeperson 13y agoI would argue that Groovy and Clojure require just as much conversion (I have no idea about Kotlin). Scala and Clojure both require conversion if you want to use idiomatic data structures. I think Groovy is actually worse about this because you get secret implicit conversion to add meta classes and null objects. I've run in to a bunch of difficult to track down bugs where Groovy has forgotten to do these conversions.
- felipehummel 13y agoYou can actually make it automatically convert in both directions with just an import. But it is good practice to do it explicitly. In my opinion, for a typesafe language, this is a good way to do it.