Arc Forumnew | comments | leaders | submitlogin
4 points by bogomipz 5914 days ago | link | parent

Wasn't part of the problem that they made the innermost do the scope of the variable? What if they had used the outermost do instead? That would normally mean a def, which would be quite intuitive for the user.

The compiler should then be smart enough to figure out which closures actually make use of the variable and optimize away the overhead of holding onto a variable that is not needed.