3 ms·
The paper seems to go into this. * There is no generic way to say whether a defer should free up a variable based on the value it has when the defer was encoun
by mpyne 5y ago
The paper seems to go into this.
* There is no generic way to say whether a defer should free up a variable based on the value it has when the defer was encountered, or a potentially-different value the variable might have when the defer is actually run.
* So the best thing to do seemed to be to give the programmer the ability to make the choice.
* Lambdas are the means they chose to make that happen.
But this all seems to stem from a desire to enable a use case beyond what an obvious use of a goto idiom would support.