Deepcopy: Difference between revisions

Content added Content deleted
Line 635: Line 635:
<lang lingo>val = [#foo:42, "bar":[1,2,3, "Hello world!"]]
<lang lingo>val = [#foo:42, "bar":[1,2,3, "Hello world!"]]
put deepcopy(val)
put deepcopy(val)
-- [#foo: 42, "bar": [1, 2, 3, "Hello world!"]]</lang>
-- [#foo: 42, "bar": [1, 2, 3, "Hello world!"]]

val = script("MyClass").new()
val.foo = 42
val.bar = [1, 2, 3, "Hello world!"]]
copy = deepcopy(val)</lang>


=={{header|Lua}}==
=={{header|Lua}}==