3 ms·
Whether closures are or are not allowed to mutate state depends on the programming language (or the aim of the programmer, if the programming language doesn't f
by pflanze 5y ago
Whether closures are or are not allowed to mutate state depends on the programming language (or the aim of the programmer, if the programming language doesn't force their way). Closures are a syntactical building block helping functional programming (building functions out of objects is just much more syntactical overhead), but whether a particular closure is a pure function or not is a separate concern. If the function is to be pure (hence satisfying the core of the "framework") then it would not be allowed to mutate state.