Trailling lambda #8437
Replies: 1 comment 1 reply
-
See: #6122 although that discussion is currently locked |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We can reference something features from other language, like kotlin
I love it(Trailing lambda) very much, and it is convenient for using
In C# we can use property like this:
public class C { public Int32 Age {get; set;} }
the property "Age" in java is used to writing a function, but in C# we can omit parentheses
In kotlin if the last parameter is lambda and we also can omit parentheses
https://kotlinlang.org/docs/lambdas.html#passing-trailing-lambdas
fun f(v:()->Unit) {xxx} fun main(){ f{ xxxx } }
Following this:
In c#
F(){} void F(Action a){}
In my idea we needn't omit parentheses because it will make diffrent meanings
Beta Was this translation helpful? Give feedback.
All reactions