Re:“ZLinq”, a Zero-Allocation LINQ Library for .NET
by whstl on Wednesday May 21, 2025 @05:39AM
(#44049769)
Good answer. To elaborate on it and provide examples.
In languages that don't have expression inspection capabilities you have to replace the `(p) => p.Price < 100` part with something that is possible for the language to inspect.
Normally it's strings or something using a builder pattern.
In languages that don't have expression inspection capabilities you have to replace the `(p) => p.Price < 100` part with something that is possible for the language to inspect.
Normally it's strings or something using a builder pattern.
For example, in TypeORM:
And in Mongoose: The LINQ-ish version would be: --Similarly, for Ruby on Rails:
Ruby's Sequel overloads operators to have a more natural syntax: But the "lambda" syntax would be: