c# - Tasks and lambda expressions syntax -


I'm new to work and still trying to understand the concept. Research: I came to the article with the following line of code:

  work & lt; Int32 & gt; T = new task & lt; Int32 & gt; (N = & gt; Yoga ((Int32) n), 1000);  

By the example, I understand that the 1000 is being passed as a argument on the Sum function, but I It does not seem to understand the syntax.

My question is how does the compiler know how to name it with n with 1000 .

The parameter of Lambda is in Lambada as n as = & Gt; . The sum () to n is passed as a logic to be called within the body of lambda expression.

If I rewrite the Lambda expression as a representative, it can be obvious to you:

  work & lt; Int32 & gt; T = new task & lt; Int32 & gt; (Rep (Int 32 N) {Return Amount ((Int32) n);}, 1000);  

It is not replaced at compile-time, but work is executed on runtime.


Comments

Popular posts from this blog

c# - Reactive Extensions ControlScheduler -

scala - Play Framework - how to bind form to a session field -

python - rpy2 import is not working -