3 ms·
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
by keyle 1y ago
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.
- deleted 1y ago[deleted]
- sobani 1y agoHow 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.
- Tyr42 1y agoR 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.