Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's a bit weird. I don't think Joe would have an issue with mutating the closed over variable, but having the closure just be the binding rather than the value, and then being able to rebind it to something else seems brittle.

> Which language does this differently?

Rust does it this way but in a less error prone way due to its sophisticated ownership tracking. If you close over a variable in the environment, it gives the ownership to the closure and you can't then rebind it outside.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: