Deepcopy: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: Fix comments: Perl 6 --> Raku) |
||
Line 1,622: | Line 1,622: | ||
(formerly Perl 6) |
(formerly Perl 6) |
||
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 |
<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. |
||