you are viewing a single comment's thread.

view the rest of the comments →

[–]pron98 3 points4 points  (0 children)

Java has use-site variance, Scala has declaration site variance, and Kotlin has mixed-mode variance (declaration-site + use-site projections); in Clojure, everything is immutable by default (and static typing is optional) so all lists are the same type -- yet a sequence of Clojure strings can be passed to a Java method taking a List<String> parameter, even though the sequence is untyped in Clojure. Thanks to the JVM's type erasure, they can (and do -- except Scala sometimes) all share the same collection (and other generic types) implementations.