voddan
05/09/2016, 7:02 PMvoddan
05/09/2016, 7:03 PMsreich
05/09/2016, 8:00 PMorangy
Arrays.fill
and it adds very little convenience, and increase (though a little) method count.orangy
mikehearn
05/10/2016, 8:53 AMmikehearn
05/10/2016, 8:55 AMmikehearn
05/10/2016, 8:55 AMholgerbrandl
05/17/2016, 7:52 PMprintln(listOf(1, 2, 3).hashCode())
println(listOf(1, 2, 3).hashCode())
println(listOf(1, 2, 3).toIntArray().hashCode())
println(listOf(1, 2, 3).toIntArray().hashCode())
which gives
30817
30817
1007251739
1556595366
jw
05/17/2016, 7:53 PMorangy
Arrays.hashCode
or Arrays.deepHashCode
orangy
holgerbrandl
05/17/2016, 8:10 PMIntArray
, DoubleArray
, etc) behind a kotlin.collections.Iterable
like interface, their primitive nature becomes too hidden to justify sticking to Java conventions here. However, I see the point that kotlin also wants to stay consistent with java where possible, so maybe you could add an inspection to warn IntArray.hashCode()
(etc.) users about the danger? This should not be too hard since there's a "hashCode() called on Array" inspection already for java.ilya.gorbunov
05/24/2016, 4:49 PMilya.gorbunov
05/24/2016, 4:55 PMilya.gorbunov
05/24/2016, 4:57 PMorangy
ilya.gorbunov
05/24/2016, 6:33 PMhastebrot
05/24/2016, 6:45 PMevanchooly
05/24/2016, 7:11 PMin progress
vs active
vs rejected
orangy
bamboo
06/02/2016, 5:11 PMLazy<T>
extend java.util.concurrent.Callable<T>
be received?bamboo
06/02/2016, 5:12 PMbamboo
06/02/2016, 5:13 PMcall() = value
ilya.gorbunov
06/02/2016, 6:01 PMfun<T> Lazy<T>.asCallable() = Callable { value }
bamboo
06/02/2016, 6:39 PMfrom(valueSource: Any)
With `Lazy<T> : Callable<T>`:
from(lazy { expensive }) // idiomatic Kotlin, user can’t forget a step, either is lazy or not
With `asCallable`:
from(lazy { expensive }.asCallable()) // non idiomatic, user might forget asCallable() and get runtime exception
bamboo
06/02/2016, 6:40 PMasCallable()
wouldn’t be needed because one can write:
from(Callable { expensive })
bamboo
06/02/2016, 6:41 PMilya.gorbunov
06/02/2016, 6:54 PMLazy
extend Callable
would introduce binary incompatibility for those who have already implemented Lazy in their APIs, so I'm afraid this train has gone.ilya.gorbunov
06/02/2016, 7:01 PMfrom(source: Any)
function, I doubt that having a function that accepts Any
and behaves differently based on the actual type of source
is idiomatic in a statically typed language such as Kotlin is.