Skip to main content

Questions tagged [mutability]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
Dannyu NDos's user avatar
6 votes
2 answers
321 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 ...
user23013's user avatar
  • 2,568
15 votes
7 answers
2k 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 ...
kaya3's user avatar
  • 20k
9 votes
2 answers
361 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 ...
Aster's user avatar
  • 3,238