Deepcopy: Difference between revisions

m
>1levels
m (>1levels)
Line 1,055:
 
=={{header|Phix}}==
Handled natively. Phix uses reference counting with copy-on-write semantics; the initial copy is fast even for huge complex and deeply nested structures (copying a single machine-word-sized reference and incrementing a single machine-word-sized reference count), and when a shared object (anything with a refcount>1) is modified, an internal clone of justthe oneminimum affectednecessary levellevels occurs, with all the rest of the structure remaining shared (but obviously still properly protected in the same way).
<lang Phix>object a, b
a = {1,{2,3},"four",{5.6,7.{8.9}}}
7,813

edits