I found myself needing a deep copy of a ref object, and reached for the aptly 
named deepCopy proc in System.

But then I got the error: "for --gc:arc|orc 'deepcopy' support has to be 
enabled with --deepcopy:on"

I suppose I'll turn it on, but it seems like there must be a performance 
trade-off? (If not, should this flag be the default?)

I do see past discussion about deprecating deepCopy in favor "move" or "send" 
(names I would never guess). And I'm getting the distinct impression that using 
deepCopy is bad practice somehow.

But even outside the context of multi-threading, would it not sometimes be 
useful to create a new object by (deep)copying an old one and tweaking it? It's 
not maximally efficient, but saves a lot of boilerplate vs constructing a new 
object using each of the old object's properties one by one, especially for big 
objects.

But I want to improve, so if there's some reason for avoiding it, please let me 
know. 

Reply via email to