Hacker News new | ask | show | jobs
by debugnik 1046 days ago
Well, most people learn about variables [1] before variables [2], so I find it funny that you think of the mutable ones as English.

Mutable variables are better explained as slots or cells, I think. Both OCaml and Rust have a concept of ref cells, for example (and they entirely replace mutable local variables in OCaml).

1: https://en.m.wikipedia.org/wiki/Variable_(mathematics) 2: https://en.m.wikipedia.org/wiki/Variable_(computer_science)

1 comments

F# has ref cells too but they are discouraged in favour of the mutable keyword
I know, inherited from OCaml. I was talking more about which metaphors to push for instead, rather than any actual data structure.