Serge Shustov
07/11/2021, 10:24 AMakuleshov7
07/11/2021, 1:45 PMarthur_sav
07/11/2021, 2:16 PMIfvwm
07/12/2021, 3:48 AMIfvwm
07/12/2021, 11:58 AMclass C{
var l: () -> Unit = {println("hello")};
fun onClick(){ l() }}
val c = C()
c.l = { println("world") }
is this ok?Ifvwm
07/12/2021, 12:04 PMCameron Stuart
07/12/2021, 12:48 PMaaverin
07/12/2021, 1:44 PMjmfayard
07/12/2021, 3:31 PMJonathan Sandusky
07/12/2021, 6:19 PMMultiplatform Programming
and it says it’s in alpha
does the same go fo Kotlin for Javascript
? I’m looking to create a package that will build for JVM and JS to reduce duplicate business logic.Michael Pohl
07/12/2021, 6:29 PMQuickSort
implementation takes vs. Kotlin's own List<T>.sorted()
.
While I was on it, I also tested variations of my implementation as an extension function and without explicitly storing values in the function. And I noticed they are very different in how fast they are processed. What is causing this? See thread ->Charlie L
07/12/2021, 11:33 PMlistOf(…).map { async { someNio() } }.awaitAll()
discouraged for any reason? I came across the “worker pool” pattern.eirikb
07/13/2021, 5:25 AMASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
upon assignment only. While that warning is technically correct, and makes sense, it would be nice to remove it. How?
My code looks like this:
var ok by okProp
ok = true
where setting ok
will have side effect. Example: https://pl.kotl.in/81eXfsXLG (press run to get the warnings).
On a side note, the decompiled code looks like this:
KProperty var1 = $$delegatedProperties[0];
ReadWriteProperty ok = okProp;
ok.setValue((Object)null, var1, true);
As one would expect the variable will be both accessed and assigned, just not in KotlinPiyush Kukadiya
07/13/2021, 12:52 PMwasyl
07/13/2021, 1:17 PMZimri Leisher
07/13/2021, 6:35 PMalthaf
07/14/2021, 6:26 AMvar paymentMethod: String? = null
var result = paymentMethod?.takeIf { !it.isNullOrBlank() } ?: let { "-" }
println("output " + result)
The let part is working fine is android studio . However it is showing error in Community Edition. Is this expected or some strange behavior ?dawidhyzy
07/14/2021, 7:05 AMAlina Dolgikh [JB]
07/14/2021, 1:20 PMRoar Gronmo
07/14/2021, 1:22 PMTamarind
07/14/2021, 5:50 PMAustin Paquette
07/14/2021, 7:38 PMbody
parameter, but in my own abstraction of a client for a particular service endpoint.
Basically, I have this function (fluff removed), but point is clear.
sendNotification(listOf("..."), listOf("..."))
This is ultimately fine and works as intended, but I am trying to find a way to explicitly set each of these values. Instead I'd like to do this:
sendNotification() {
subscriberKeys = listOf("...")
users = listOf("...")
}
This helps me describe exactly what I need each value to be and then pass them through the implementation, I just don't fundamentally understand the examples provided.
I've tried with some smaller sample code but nothing quite clicks yet. I'll gladly accept links to helpful resources too, I've done a fair amount of searching but nothing has quite illuminated the lightbulb on this.althaf
07/15/2021, 6:55 AMprivate fun hideDeliveryDetailsIfNotRequired() {
if (clearingZone.title == "-" && deliverMethod.title == "-"
&& deliverTo.title == "-" && pickupLocation.title == "-"
) {
clearingZone.visibility = View.GONE
deliverMethod.visibility = View.GONE
deliverTo.visibility = View.GONE
pickupLocation.visibility = View.GONE
}
}
Matt
07/15/2021, 12:55 PMuser
07/15/2021, 2:23 PMAnamika Trivedi
07/15/2021, 2:48 PMnilTheDev
07/15/2021, 3:50 PMclass Dummy{
private val _data = mutableListOf<Int>()
val data:ListOf<Int> = _data
}
class Dummy{
private val _data = mutableListOf<Int>()
val data: ListOf<Int>
get() = _data
Thanks for your help.Jgafner
07/15/2021, 7:08 PMAlex S
07/15/2021, 11:36 PM[kapt] 'com.sun.tools.javac.util.Context' class can't be found ('tools.jar' is absent in the plugin classpath). Kapt won't work.
Dra
07/16/2021, 5:15 AMDra
07/16/2021, 5:15 AMeirikb
07/16/2021, 5:25 AMSourabh Rawat
07/16/2021, 7:50 AM