Slackbot
07/12/2019, 2:39 PMdalexander
07/12/2019, 2:55 PMkevinmost
07/12/2019, 3:06 PMmakeThing()?&.setup()?kioba
07/12/2019, 3:57 PMkioba
07/12/2019, 4:27 PMcascade notation with the .. operator. I am not sure if this is useful but it basically reduces the apply to an operator.
The only problem with replacing functions with operators is after a while everyone wants their own operator. there are languages which supports creating your own but for a newcomer it is hard to understand without codebase specific knowledge.
I agree with you, sometimes it would be comfortable to have a cascade operator or add your own but I read somewhere that the Kotlin team decided to avoid such for better readability.karelpeeters
07/12/2019, 4:34 PMtmp variable, but I don't think any of the proposed syntax in this thread is actually an improvement.kioba
07/12/2019, 4:36 PMkarelpeeters
07/12/2019, 4:42 PMapply is fine as-is.Hullaballoonatic
07/12/2019, 8:13 PMFoo() {{
//things
}}Hullaballoonatic
07/12/2019, 8:16 PMclass Foo(var bar: Int = 0) {
constructor(op: Foo.() -> Unit) : this() {
op()
}
}
val foo = Foo {
bar++
println(this)
// etc
}karelpeeters
07/12/2019, 8:22 PMarocnies
07/13/2019, 2:18 PM.. call? I don't mind Dart's syntax for it, but personally I prefer excluding it from the language in favor of apply