4 ms·
Here's an example: A Clojure list is a Java list, but Clojure is untyped. However, if you create a list of strings in Clojure, you can call any Java method that
by pron 8y ago
Here's an example: A Clojure list is a Java list, but Clojure is untyped. However, if you create a list of strings in Clojure, you can call any Java method that takes List<String> even though Clojure has no such concept. AFAIK, on the CLR, Python requires special treatment to call such a method. Also, Kotlin's and Java's variance strategy is very different. Nevertheless, Java's generic data structures are reused in Kotlin.
- tigershark 8y agoMmm.. ok, in iron Python you obviously need to specify the generic type that you are passing because it is needed to resolve the correct method, but in Java you wouldn’t. For me it’s a perfectly acceptable compromise if I can specify methods with the same signature and you can avoid passing around Class references to infer the type.
- pron 8y agoWhy do you need to pass around class references? That's exactly what I was saying about doing something wrong. In over 15 years of programming in Java heavily, I don't think I had to do that more than a couple of times.