News for hackers. Stuff that matters.
Re:Java 8 lambda syntax decided - same as C# and Scala by onedognight on Thursday September 08, 2011 @09:02PM (#2976344)
According to the grammar int the OP, you need ()'s, no?

  new Thread(() => { doStuff(); }).Start();
Or can they be elided in C# or Scala?
Re:Java 8 lambda syntax decided - same as C# and Scala by swax on Thursday September 08, 2011 @09:20PM (#2976376)
Actually for just that example you don't need any of it. new Thread(doStuff).Start();
Re:Java 8 lambda syntax decided - same as C# and Scala by MatthewPhillips on Thursday September 08, 2011 @09:23PM (#2976383)
nah, it would have to be new Thread(new ThreadStart(doStuff)).Start();
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".
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");
Re:Java 8 lambda syntax decided - same as C# and Scala by gnuvince on Thursday September 08, 2011 @09:18PM (#2976369)
The empty () are required in Scala. Don't know about C#.
Re:Java 8 lambda syntax decided - same as C# and Scala by latch on Thursday September 08, 2011 @09:35PM (#2976411)
yes, they are in C# as well.