2 ms·
Do you often need non-trivial lambdas that you completely construct at runtime? Second-class functions can still be passed around. They just can't be construct
by nine_k 3y ago
Do you often need non-trivial lambdas that you completely construct at runtime?
Second-class functions can still be passed around. They just can't be constructed at runtime, you would have to declare them.
Maybe some "first-and-a-half order" approach to functions could work. You could still declare lambdas in place, but they won't have direct access to anything local to your function; instead of a closure, everything needed would have to be passed as a parameter. It could even allow partial application using local variables; values wound just be copied, not closed over.
- davexunit 3y ago> Do you often need non-trivial lambdas that you completely construct at runtime? Yes. It's very common to have a function that returns another function. It's a pretty critical feature.