4 ms·
Different languages deal with the constraint you describe in interesting ways. PHP has the “use” keyword, which captures variables explicitly. You can’t captur
by dgb23 3y ago
Different languages deal with the constraint you describe in interesting ways.
PHP has the “use” keyword, which captures variables explicitly. You can’t capture anything in the outer frame otherwise.
I wonder now if this has any performance implications.
In Rust, every captured variable is statically checked. The compiler knows that you capture a mutable reference for example. This often means that you need to express additional constraints in order to satisfy ownership semantics.
Now again, I wonder what the implications are on the generated code.