What you need here is not the stability in memory (i.e. of pointers, which you lose when you recreate an object) but instead just the stability of an identifier (e.g. the index into a list).
- Posts
- 1
- Comments
- 50
- Joined
- 3 yr. ago
- Posts
- 1
- Comments
- 50
- Joined
- 3 yr. ago
- JumpDeleted
Permanently Deleted
- JumpDeleted
Permanently Deleted
- JumpDeleted
Permanently Deleted
- JumpDeleted
Permanently Deleted
- JumpDeleted
Permanently Deleted
- JumpDeleted
Permanently Deleted
That's the point, when programming with immutable structures you always pass the mutability onto the enclosing structure.
A list is an antipattern here IMO. Just wrap it in some dedicated object (see e.g. Java's
StringBuilder).