Deepcopy: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: .perl -> .raku) |
|||
Line 1,848: | Line 1,848: | ||
<br> |
<br> |
||
'''2) Use <code>. |
'''2) Use <code>.raku.EVAL</code>:''' |
||
<tt>. |
<tt>.raku</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. |
||
<lang perl6> |
<lang perl6>my %x = foo => 0, bar => [0, 1]; |
||
⚫ | |||
my %x = foo => 0, bar => [0, 1]; |
|||
⚫ | |||
%x<bar>[1]++; |
%x<bar>[1]++; |