2 ms·
I don't think there's any way to avoid that. You could always copy, but then you'd sacrifice performance. You could always make a reference, but then other part
by bachmeier 7y ago
I don't think there's any way to avoid that. You could always copy, but then you'd sacrifice performance. You could always make a reference, but then other parts of the language would become really complicated.
- derefr 7y agoOr you could use functional persistent data structures for your stdlib types, like Erlang’s map. (Essentially, “reference on read, amortized copy on write.”)