Bernhard
04/10/2019, 9:40 AMif(obj.string?.isBlank() ?: true)
which is hard to read imhoSmallville7123
04/10/2019, 11:15 AMjeggy
04/10/2019, 1:45 PMabstract class A {
abstract val value: String
abstract fun <T: A> test(): T
}
data class B(
override val value: String,
val value2: String
): A() {
override fun test()
= this.copy(value = "HelloWorld")
}
How can I achieve something like this?user
04/10/2019, 1:56 PMKinsonDigital
04/10/2019, 2:15 PMrook
04/10/2019, 3:51 PMlistOf("a", "b", "b", "a", "b").distinctFromAdjacent()
// result a,b,a,b
Dias
04/10/2019, 4:02 PMlistOf("a", "b", "c", "c").fold(mutableListOf<String>()) { acc , s ->
if (s != acc.lastOrNull()) {
acc.add(s)
}
acc
}
maybe?
Ah no it's not going to work, it will just remove all consecutive characters except the first onegrandstaish
04/10/2019, 4:23 PMequals
and hashCode
in an inline
class? The KEEP mentioned it was possible, but it doesn't seem to work for meHullaballoonatic
04/10/2019, 6:02 PMSmallville7123
04/11/2019, 10:33 AMglibc
in kotlin-native
instead of C
(assuming kotlin-native
supports linking with assembly
and supports inline assembly
)GarouDan
04/11/2019, 12:11 PMspecially girls
,
I would like to ask you a question.
Sometimes I use Hi guys
here, but I’ve seen that maybe some people feels uncomfortable with that.
So I would like to ask you, some of you feel excluded with this expression? Since I’m not from an English country I would like to know how it goes here
I asked my English teacher that is from England and he said to me:
Guys is totally generic. You can even call a group of only women, "guys"
And I have followed a course with an American English teacher that call us guys in her videos.
So, what do you think about it?Dias
04/11/2019, 12:13 PMthiagoretondar
04/11/2019, 12:41 PM{
exampleArray: {{input.prices.filter(price -> price <= 100)}}
}
Any tips on how to build this kind of “template string”? Regex? Finite state transducer?dreamreal
04/11/2019, 3:31 PMval klass=elt::klass
klass.memberProperties.map { prop -> /* something here */ },joinToString()
- I just can't figure out what belongs in something here
such that the property is extracted from elt
sunbreak
04/11/2019, 4:11 PMbjonnh
04/11/2019, 5:33 PMSamer Hobeika
04/11/2019, 5:35 PMdumptruckman
04/11/2019, 6:35 PMSomeJavaType.fromString("something")
Hullaballoonatic
04/11/2019, 8:01 PMclass Matrix(elements: Collection<Collection<Double>>): MutableList<Vector> by data {
val data = ObservableList<Vector>(elements.map { it.toVector() } , ::onAdd, ::onRemove)
}
Robert
04/11/2019, 9:10 PMUnresolved reference: ByteBuffer
on the line where I do import kotlinx.io.ByteBuffer
. In my build.gradle.kts
I have this line implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.9.0")
, which also shows under the Extenal dependencies
in my IDE. What could I do wrong?user
04/12/2019, 4:33 AMPaul Woitaschek
04/12/2019, 8:21 AMprivate inline fun updateRegistrationState(update : RegistrationState.()->RegistrationState){
registrationState = update(registrationState)
}
I would like to call it as:
updateRegistrationState { gender = Gender.MALE }
instead of updateRegistrationState { copy(gender = Gender.MALE) }
Dennis Schröder
04/12/2019, 9:41 AMdata class Foo(val one: String, val two: String) {
fun bar() = println(one + two)
}
fun Foo.bar() = println(one + two)
Can anybody explain me the difference? Is it just another way of writing the same functionality?
Are there rules when it is better to use member functions and when extension functions? I thought of extension functions of mostly useful to extend third party code.dagguh
04/12/2019, 9:56 AMinternal
is public
in Java, so our libs leak internal API
is there a way to post-process Kotlin-generated bytecode to translate the internal to package-private?hho
04/12/2019, 12:09 PMstreetsofboston
04/12/2019, 2:33 PMkarelpeeters
04/12/2019, 4:25 PM<in T>
on the interface.Nikky
04/13/2019, 2:18 AMSmallville7123
04/13/2019, 9:59 AMSmallville7123
04/13/2019, 1:07 PMclass a(param1: Int) { val parameter1 = param1; }
Smallville7123
04/13/2019, 1:07 PMclass a(param1: Int) { val parameter1 = param1; }
Shawn
04/13/2019, 1:29 PMclass A(val param1: Int)
data class A(val param1: Int)
both work fineSmallville7123
04/13/2019, 3:38 PM