I.E. if I have {a:{aa:"1"},b:"cc"} and I change b, then {aa:"1"} will not be deep copied.
Are you talking about something like keeping a reference to the parent and sending lookups up the chain (with a prototype or some such?)
> Persistent data structures are different, as their performance improvements are passive. Although seamless-immutable does not (and cannot, while maintaining its backwards compatibility with vanilla JS collections) use things like VLists under the hood, its cloning functions—such as merge—only bother to make shallow copies, as shallow and deep copies of immutable values are equivalent. In practice, this simple passive optimization has been sufficient; we have yet to encounter a performance problem that Bagwell-style persistent data structures would have solved.
from: http://tech.noredink.com/post/107617838018/switching-from-im...
a \
c-d-e
b /
The memory for the original list is still shared!
You can generalize that to trees and use that to implement, say, persistent hashmaps that can share data.This is also awesome for parallelization where you want to share data but don't need synchronization!