horse_badorties07/30/2017, 8:22 AM
in the first place? Why not use
and let the compiler optimize them away as JVM Arrays where possible?
voddan07/30/2017, 11:13 AM
horse_badorties07/30/2017, 2:11 PM
is a :java: class, not a :kotlin: class, so I'm not sure why that would be relevant.
diesieben0707/30/2017, 2:28 PM
by compiler magic.
voddan07/30/2017, 3:54 PM
is an interface,
is a class, one can't replace the other.
as an example of a
which is indeed very optimized by JVM
horse_badorties07/30/2017, 8:14 PM
altogether and only provide the
type hierarchy - an Array being essentially a mutable, fixed-sized List. I have yet to understand your "Arrays are here because Java has them, and thus :kotlin: has to express this concept." I'm not saying you are wrong, but I still don't really understand the "why". 🙂
diesieben0707/30/2017, 8:16 PM
horse_badorties07/30/2017, 8:18 PM
diesieben0707/30/2017, 8:26 PM
is a high-level implementation. You need low-level building blocks (like arrays) for when you need performance or exact control.
is not possible if you don't have arrays.
horse_badorties07/30/2017, 8:30 PM
is only one-dimensional, so it doesn't even "express the complete concept" of JVM/Java Arrays.
diesieben0707/30/2017, 8:37 PM
horse_badorties07/30/2017, 8:38 PM
diesieben0707/30/2017, 8:39 PM
horse_badorties07/30/2017, 8:41 PM
diesieben0707/30/2017, 8:41 PM
voddan07/30/2017, 9:12 PM
Arrays are here because Java has them, and thus :kotlin: has to express this concept.Consider if java exposes overloads
, how do you call one over the other if you can't provide an array?