4 ms·
You can intern strings without preventing mutability using the copy-on-write principle. PHP does it.
by TazeTSchnitzel 5y ago
You can intern strings without preventing mutability using the copy-on-write principle. PHP does it.
- recursive 5y agoIf you copy before you write, you're not mutating, you're making a new thing. e.g. This pseudo code must stand for mutation to be present. a = ... b = a mutate(a) /* b now mirrors a */
- TazeTSchnitzel 5y agoA language runtime can make that work if it wants to. High-level semantics don't need to constrain the implementation.
- deleted 5y ago[deleted]