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

If it behaves like that it is not a closure.


a closure can capture either the value or the reference of the variables.

in this case it captured the reference which at the time of invocation always pointed to the same value.


capturing by reference is nonsense in 99.9999999% cases


it still makes it a valid closure.


as you could have seen it does not make a valid closure, only source of bugs




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

Search: