brk
07/07/2017, 7:54 AMenleur
07/07/2017, 7:56 AMbrk
07/07/2017, 7:59 AM5fa79fa Sliding window implementation helper utilities 3 weeks ago Sergey Mashkov
nkiesel
07/11/2017, 6:10 PMList
have a size
property but not an empty
property?ilya.gorbunov
07/11/2017, 6:15 PMbreandan
07/13/2017, 6:26 PMoperator fun <T> KProperty0<T>.getValue(thisRef: Any?, property: KProperty<*>) = get()
operator fun <T> KMutableProperty0<T>.setValue(thisRef: Any?, property: KProperty<*>, value: T) = set(value)
This would let me use bound callable references as a property "alias". This enables me to write:
var propertyAlias by property1::property2
Otherwise, in order to to get the same functionality, I would need to write a custom getter/setter:
var propertyAlias
get() = property1.property2
set(value) {
property1.property2 = value
}
I believe this is a common enough scenario to warrant a stdlib
addition. Thank you.kirillrakhman
07/13/2017, 6:30 PMkirillrakhman
07/13/2017, 6:31 PMbreandan
07/13/2017, 6:32 PMkirillrakhman
07/13/2017, 6:32 PMagomez
07/13/2017, 6:33 PMpavlospt
08/08/2017, 7:44 AMpavlospt
08/08/2017, 7:44 AMkarelpeeters
08/08/2017, 8:10 AMFloat.toLongExactOrNull()
and friends even defined? A google search only results in the _Ranges.kt
file.pavlospt
08/08/2017, 8:39 AMilya.gorbunov
08/09/2017, 4:35 PMClosedRange.contains
is a virtual method, which can be implemented differently in inheritors.
We've strived to reimplement contains
extensions such that they delegated the check to the contains
member.
It turned out that could lead to some weird results related to rounding, as it was mentioned in the issue https://youtrack.jetbrains.com/issue/KT-18938. We're still to discuss what should be the correct behaviour in that case.ilya.gorbunov
08/09/2017, 4:51 PM3.5
be in an IntRange 1..4
given that it's never returned when we iterate values of that range?jw
08/09/2017, 4:52 PMkevinmost
08/09/2017, 4:53 PMdmcg
08/10/2017, 10:41 AMnatpryce
08/10/2017, 1:26 PMsealed class Result<T, ERR>
data class Success<T>(value: T): Result<T, Nothing>()
data class Failure<ERR>(failure: ERR): Result<Nothing,ERR>()
and associated extension functions like map
, flatMap
, etc.?kirillrakhman
08/10/2017, 1:33 PMdmcg
08/10/2017, 2:01 PMdmcg
08/10/2017, 2:03 PMjw
08/10/2017, 11:17 PMkarelpeeters
08/11/2017, 7:17 AM@Throws
also part of the documentation of a function?jw
08/11/2017, 2:05 PM@throws
for KDockarelpeeters
08/15/2017, 6:45 PMInteger
and Long
have methods for getting the sign of a value, can something like this be added to Kotlin's versions as well?jw
08/15/2017, 7:27 PM