Comment

Comment by nkohari

Fair enough, if you want to automatically execute an anonymous function, your example isn't idiomatic C# either. The idiomatic version would look like this:

    var func = () => "foo";
    func();
As far as "you don't see this type of code being used much", that's just patently false. Anonymous functions (particularly predicates) are the whole way you interact with LINQ.

So I'll ask this: what's the equivalent example in Java?

parent nkohari 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton