Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C#, Swift, Dart, Rust... Python. Many languages take lambda/predicate/closure as filter/where.

It generally unrolls as a `for loop` underneath, or in this case LINQ/SQL.

C# was innovative for doing it first in the scope of SQL. I remember the arrival of LINQ... Good times.



How many of those languages can take an expression instead of a lambda?

Func<..> is lambda that can only be invoked.

Expression<Func..>> is an AST of a lambda that can be transformed by your code/library.


R let's you do that, and it gets used by the tidy verse libraries to do things like change the scope variables in the functions are looked up in.




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

Search: