Re:Java 8 lambda syntax decided - same as C# and Scala
by jeffz on Thursday September 08, 2011 @09:56PM
(#2976456)
Sorry, but since C# 2.0 we could just write "new Thread(DoStruff)" or "SomeDelegate del = SomeMethod".
[ Parent
| on HN ]
Re:Java 8 lambda syntax decided - same as C# and Scala
by politician on Thursday September 08, 2011 @11:32PM
(#2976660)
I can't resist, so,
public static class ActionExtensions
{
public static void InvokeAsync(this Action<object> target, object context)
{
new Thread(obj => target(obj)).Start(context);
}
}
((Action<object>) (Console.WriteLine)).InvokeAsync("Hello, World");