Hacker News new | comments | show | ask | jobs | submit login

For comparison, I came up with this in C#

  Func<int, int, int> sum = (x, y) => x + y;
I had to specify the type explicitly, could not use 'var' type inference; the error is "Cannot assign lambda expression to an implicitly typed local variable". This is because the lambda could mean more than one kind of thing (delegate, expression tree, Func<>). Yeah, it's c# baggage.

Of course, once the type is known, you could do

  var sum2 = sum;

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact