Hacker News new | ask | show | jobs
by brianwillis 3323 days ago
> If a lambda has only one parameter then its declaration can be omitted (along with the ->). The name of the single parameter will be "it".

> val notPositive = not {it > 0}

This idiom took me by surprise. It's really quite lovely, and now I'm disappointed C# doesn't include it.

1 comments

The schools for and against anaphoric syntax constructs are pretty divided 50-50. "It" is certainly better than scala's underscore.