3 ms·
Rust does something very similar, albeit with lambdas for extra syntax goodness.
by vvanders 11y ago
Rust does something very similar, albeit with lambdas for extra syntax goodness.
- Manishearth 11y ago(to be clear, lambdas aren't necessary for this pattern to work in Rust, just that the stdlib has generic iterator adapters that are created using lambdas letting you do a myriad of things with a single function. Rust lambdas (closures) are on the stack, so this usually gets optimized down to a for loop or something)