Deepcopy
Raku doesn't currently provide a proper mechanism for deep copies, but depending on your requirements you could use one of these work-arounds:
1) Use .deepmap(*.clone)
:
.deepmap
constructs a copy of the data structure, and .clone
makes a shallow copy of each leaf node. Limitations:
Output:
2) Use .raku.EVAL
:
.raku
serializes the data structure to Raku code, and .EVAL
deserializes it. Limitations:
Output:
Last updated