Hacker News new | ask | show | jobs
by bachmeier 2518 days 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.
1 comments

Or you could use functional persistent data structures for your stdlib types, like Erlang’s map. (Essentially, “reference on read, amortized copy on write.”)