Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Pascal

Idiom #311 Deep copy an object

Create the new object y by cloning the all the contents of x, recursively.

classes
var
  x,y: TPersistent;
...
  y.assign(x);
...
let y = structuredClone(x);

New implementation...
< >
programming-idioms.org