Utilities

Copy

Make a "shallow" copy (copy)

A shallow copy constructs a new compound object and then (to the extent possible) inserts references into it to the objects found in the original.

 

{ }
[{"data":{"type":"variable","step":"x = 10","var":"x","val":10,"maxpaths":1,"uuid":"d7db099a1a3f9e2df693cd4422bb26cb","x":300,"y":320,"width":120,"height":32},"paths":["2972ab09b5a4051dd5d340e725fb6ccc"]},{"data":{"type":"variable","step":"dict\/object to copy","var":{"variable":{"~":"x"},"int":10,"bool":true,"number":10.42},"val":true,"maxpaths":1,"uuid":"2972ab09b5a4051dd5d340e725fb6ccc","x":300,"y":400,"width":120,"height":32},"paths":["9148d39266042bc89aff74e46b1a483b"]},{"data":{"type":"library","step":"copy dict\/object","call":"utilities.copy.copy","args":{"value":"{\"~\":\"obj\"}"},"maxpaths":1,"uuid":"9148d39266042bc89aff74e46b1a483b","x":300,"y":480,"width":120,"height":32,"utilities":"utilities","utilities.copy.copy":"copy","data_to_var":"result"},"paths":[]}]

Example Response

{"result":{"variable":{"~":"x"},"int":10,"bool":true,"number":10.42}}

Make a "deep" copy (deepcopy)

A deep copy constructs a new compound object and then, recursively, inserts copies into it of the objects found in the original.

 

{ }
[{"data":{"type":"variable","step":"x = 10","var":"x","val":10,"maxpaths":1,"uuid":"d7db099a1a3f9e2df693cd4422bb26cb","x":300,"y":320,"width":120,"height":32},"paths":["2972ab09b5a4051dd5d340e725fb6ccc"]},{"data":{"type":"variable","step":"dict\/object to copy","var":{"variable":{"~":"x"},"int":10,"bool":true,"number":10.42},"val":true,"maxpaths":1,"uuid":"2972ab09b5a4051dd5d340e725fb6ccc","x":300,"y":400,"width":120,"height":32},"paths":["9148d39266042bc89aff74e46b1a483b"]},{"data":{"type":"library","step":"copy dict\/object","call":"utilities.copy.deepcopy","args":{"value":"{\"~\":\"obj\"}"},"maxpaths":1,"uuid":"9148d39266042bc89aff74e46b1a483b","x":300,"y":480,"width":120,"height":32,"utilities":"utilities","utilities.copy.deepcopy":"deepcopy","data_to_var":"result"},"paths":[]}]

Example Response

{"result":{"variable":10,"int":10,"bool":true,"number":10.42}}