Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lambdas and closures in C#
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Action<int> lambda = (x) => { lambda = (y) => { lambda = (z) => { Console.WriteLine(x + y + z); }; Console.WriteLine(x + y); }; Console.WriteLine(x); }; lambda(2); lambda(3); lambda(4); } } }
run
|
edit
|
history
|
help
0
my cool stuff
1
jahs
Ordinalator
6
test
a.k.java
Enum Extension
Free Tiktok Fans Generator
TestCodec1