> Do you have any examples?
Sure, write a self-executing function in C#.
Sure, write a self-executing function in C#.
((Action)(() => Console.WriteLine("Hello")))();
or new Action(() => Console.WriteLine("Hello"))();
Yeah, it's verbose because you have to cast the lambda expression before executing it, but honestly I don't know any case where a self executing function can be useful in C#. (new Func<int>(() => 2))();