Deepcopy: Difference between revisions

Lingo added
m (→‎Depth-first: Small changes mainly in comments.)
(Lingo added)
Line 613:
 
<lang Lasso>local(copy) = #myobject->ascopydeep</lang>
 
=={{header|Lingo}}==
<lang lingo>-- supports lists, property lists, images, script instances and scalar values (integer, float, string, symbol)
on deepcopy (var)
case ilk(var) of
#list, #propList, #image:
return var.duplicate()
#instance:
copy = var.script.rawNew()
repeat with i = 1 to var.count
copy.setProp(var.getPropAt(i), deepcopy(var[i]))
end repeat
return copy
otherwise:
return var
end case
end</lang>
 
=={{header|Lua}}==
Anonymous user