Questions tagged [mutability]
The mutability tag has no summary.
5 questions
11
votes
7
answers
2k
views
Expressing immutable, cyclic data structures
Many commonly used programming languages offer built-in mutable container types, or other mutable types that embed references to other objects, and make it trivial to build structures that contain a ...
9
votes
6
answers
4k
views
Would it be safe to introduce the "freeze" statement?
Would it be safe to introduce the freeze statement for freezing a mutable object into an immutable object?
Such statement would mix well into dynamically-typed ...
6
votes
2
answers
416
views
How useful is the traditional const in addition to constexpr and rvalue references?
In C++, there are two newly created features related to const: constexpr and rvalue references. (IMHO rvalue reference is not ...
15
votes
7
answers
3k
views
What approaches are there to prevent modifying a collection while iterating over it?
A frequent source of bugs in some languages, is to modify a mutable collection while iterating over it. Appending to a list while iterating over it can cause an infinite loop, while removing from it ...
10
votes
2
answers
418
views
How do you design mutable lists?
Background
I have a problem designing a list structure for my language.
My language use explicitly mutability, that is, all mutability must be manually marked.
But when I marked the mutability of ...