dalexander
06/19/2017, 2:35 PMsomeFun() {}
is legal syntax, and it’s not splitting your statement based on newlines. So the compiler is really parsing that chunk of code like: println("a", { println("b") }())
which isn’t legal I suspect.kirillrakhman
06/19/2017, 2:45 PMrun { println("b") }
because it gets inlinedeshioji
06/19/2017, 2:54 PM()
from the second line, but naively one would think this shouldn’t compile…eshioji
06/19/2017, 2:55 PMsomeFun2
makes perfect sense to me, but the way someFun
can be invoked looks “wrong” to me (someFun({ println("b")})
would be “correct” in my eyes)kirillrakhman
06/19/2017, 2:58 PMkirillrakhman
06/19/2017, 2:58 PMeshioji
06/19/2017, 2:58 PMeshioji
06/19/2017, 2:59 PMkirillrakhman
06/19/2017, 3:00 PMkirillrakhman
06/19/2017, 3:00 PMIn Kotlin, there is a convention that if the last parameter to a function is a function, and you're passing a lambda expression as the corresponding argument, you can specify it outside of parentheses
Note that the parentheses in a call can be omitted entirely if the lambda is the only argument to that call
eshioji
06/19/2017, 3:01 PMeshioji
06/19/2017, 3:01 PMpoohbar
06/19/2017, 6:26 PMwithResource
extension function which looks almost like a dedicated keyword from the use site.rs3vans
06/20/2017, 1:07 AMeshioji
06/20/2017, 7:46 AMchalup
06/20/2017, 9:51 AMchalup
06/20/2017, 9:51 AMchalup
06/20/2017, 9:52 AMchalup
06/20/2017, 10:17 AMchalup
06/20/2017, 10:25 AMchalup
06/20/2017, 10:25 AMchalup
06/20/2017, 10:25 AMghislainthau
06/20/2017, 2:13 PMmrtact
06/20/2017, 4:50 PMmrtact
06/20/2017, 4:51 PMtbsvttr
06/20/2017, 8:04 PMRuckus
06/20/2017, 8:12 PMwitoldsz
06/20/2017, 8:16 PM1) How is Kotlin superior or more worth learning than C#?Learn both and have your say 🙂
x80486
06/20/2017, 8:19 PMroberto.guerra
06/20/2017, 8:20 PM