I belive kotlin have something called dataargument...
# compose
s
I belive kotlin have something called dataargument but i cannot find the documentation.
Copy code
fun someFun(arg1: String, arg2: Int, arg3: ()-> Unit) {
  ....
}

dataargument SomeFunArgument(arg1: String = "", arg2: Int = 1, arg3: ()-> Unit ={})

// invocation
val arg = SomeFunArgument()
someFun(arg)

// altered invocation
someFun(arg.copy(arg3 = { println("altered") } )
that mechanism will help so much with design token. somehow i can't find the documentation
i
It is just a proposal (planned for Kotlin 2.2): https://x.com/marcinmoskala/status/1810237393326227747?s=19
s
ah.. it will be very helpful for tokenization in compose
r
Yes indeed. It's something we've been asking for for years 😁 (under a different shape but same idea)
s
it also makes every function pure function, i wonder why it held so long, probably because the design concept is not yet made
also last time i try it, there is a problem with composition especially with lamda and event propagation
if we use data class to wrap arguments