|
|
|
|
|
by rdtsc
3813 days ago
|
|
> By default, the closure is capturing an immutable reference I think some imperative languages still refer to those things as closures, which is unfortunate. Capturing a closure then having everything in there mutable kind of defeats the purpose in my opinion. But maybe I've been damaged/spoiled by functional programming and/or have spent to much time debugging issues related to concurrency and shared mutable state. |
|
On the other hand, if your closure depends on global mutable state, than you have a piece of GLOBAL state that is VARIABLE. Sometimes known as the root of all evil.
But maybe I've been damaged/spoiled by scheme and/or not done enough concurrency programming to get your point.