Lambda

<p>x =&gt; x * x &#160;&#160;// A simple expression that returns the square of its parameter<br /> &#160;&#160;&#160;// The type of parameter x is inferred from the context.</p> <p>x =&gt; { return x * x ; } &#160;// Semantically the same as the preceding<br /> &#160;&#160;&#160;// expression, but using a C# statement block as<br /> &#160;&#160;&#160;// a body rather than a simple expression</p> <p>(int x) =&gt; x / 2 &#160;&#160;// A simple expression that returns the value of the<br /> &#160;&#160;&#160;// parameter divided by 2<br /> &#160;&#160;&#160;// The type of parameter x is stated explicitly.</p> <p>() =&gt; folder.StopFolding(0) &#160;// Calling a method<br /> &#160;&#160;&#160;// The expression takes no parameters.<br /> &#160;&#160;&#160;// The expression might or might not<br /> &#160;&#160;&#160;// return a value.</p> <p>(x, y) =&gt; { x++; return x / y; } // Multiple parameters; the compiler<br /> &#160;&#160;&#160;// infers the parameter types.<br /> &#160;&#160;&#160;// The parameter x is passed by value, so<br /> &#160;&#160;&#160;// the effect of the ++ operation is<br /> &#160;&#160;&#160;// local to the expression.</p> <p>(ref int x, int y) { x++; return x / y; } &#160;// Multiple parameters<br /> &#160;&#160;&#160;&#160;// with explicit types<br /> &#160;&#160;&#160;&#160;// Parameter x is passed by<br /> &#160;&#160;&#160;&#160;// reference, so the effect of<br /> &#160;&#160;&#160;&#160;// the ++ operation is permanent.</p>

{{opmerking.Naam}}:

{{opmerking.OpmerkingText}}

            

Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!