Deepcopy: Difference between revisions

Content added Content deleted
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: Fix comments: Perl 6 --> Raku)
Line 1,622: Line 1,622:
(formerly Perl 6)
(formerly Perl 6)


Perl 6 doesn't currently provide a proper mechanism for deep copies, but depending on your requirements you could use one of these work-arounds:
Raku doesn't currently provide a proper mechanism for deep copies, but depending on your requirements you could use one of these work-arounds:


<br>
<br>
Line 1,647: Line 1,647:
'''2) Use <code>.perl.EVAL</code>:'''
'''2) Use <code>.perl.EVAL</code>:'''


<tt>.perl</tt> serializes the data structure to Perl 6 code, and <tt>.EVAL</tt> deserializes it. Limitations:
<tt>.perl</tt> serializes the data structure to Raku code, and <tt>.EVAL</tt> deserializes it. Limitations:
* Doesn't work correctly if the data structure contains elements that can't be properly serialized, such as closures or file handles.
* Doesn't work correctly if the data structure contains elements that can't be properly serialized, such as closures or file handles.