lambdas and type inferrence are underrated. Lambdas can have multiple statements and theydouble as a compatible delegate object automatically (just make sure the signature match) as in:
Note that I don't have a
new CancellationEventHandler nor do I have to specify types of sender and e , they're inferable from the event. Which is why this is less cumbersome to writing the whole delegate (blah blah) which also requires you to specify types of parameters.
Lambdas don't need to return anything and type inference is extremely powerful in context like this.
And BTW, you can always return Lambdas that make Lambdas in the functional programming sense. For example, here's a lambda that makes a lambda that handles a Button.Click event:
Note the chaining:
(dx, dy) => (sender, e) =>
Now that's why I'm happy to have taken the functional programming class :-)
Other than the pointers in C, I think it's the other fundamental thing you should learn :-)
|
All Types GNIIT/NIIT Solution (Mr Jerry) Follow me on G+ and Twitter for more updates Twitter @mrjerry0001 #Write for us and get paid contact us On hike App:- @mrjerry4968
Pages
- Home
- HTML LAB@HOME
- DSA LAB@HOME
- WCD LAB@HOME
- C# LAB@HOME
- RDBMS LAB@HOME
- IADRT Lab@home
- EBDD LAB@HOME
- ACPC Lab@home
- LBEPS Lab@home
- ICTWC LAB@HOME
- SQL LAB@HOME
- WINDOWS APP LAB@HOME
- JAVA LAB@HOME
- NETWORK ESSENTIALS + LAB@HOME
- ASP.NET LAB@HOME
- LBEPS CYCLE TEST
- ASP.NET CYCLE TEST
- JAVA CYCLE TEST
- RDBMS CYCLE TEST
- DSA CYCLE TEST
- NIIT-HTML CYCLE TEST
- NIIT ASSIGNMENTS
- NIIT PROJECTS
- CORE JAVA NOTES
- NIIT BOOKS
- NIIT MT SOLVED
Friday, 24 June 2016
Hidden Features of C#?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment