I'm trying to factor out the interior mutability in my Rust code. It's a little more verbose, but surprisingly readable.
foo_old(&syntax);
foo_new(&syntax, &mut change_map);
Signatures are way more self-documenting with this approach.
miniblog.
Related Posts
You can go so far with simple data in Rust that it's kinda surprising when you start learning about interior mutability: https://doc.rust-lang.org/std/cell/index.html
If you give a function a value of &T, they can actually mutate any cells within it. It's not sufficient to look for &mut T usages.
Which would you rather refactor: a codebase with immutable types but dynamic types, or pervasive mutability with static types, and why?
At worst, the mutability of Emacs promotes a spreadsheet level of s/w engineering. At best, it's a full-blown lisp machine with a fast CPU.