Cool! Why a reference type instead of a value type?
Conversation
It made more sense that way to be able to mirror the underlying ObjC structure. Do you see a meaningful diff. as a class?
2
Value semantics are enormously different (cf my objc.io article). You do have the tools.
2
how do you solve the issue of hoisting "unshare()" calls out of loops, etc? Doesn't that required compiler support?
1
Not sure why you need to hoist unshare out of loops if you avoid making a copy of the internal reference until value is mutated
2
but that would be a restriction that would have to be imposed on end users - easy to unknowingly do that sort of thing.
1
Same semantics as Array. Do you think Array is problematic too?
1
is that true? I was told that the Swift compiler optimizes this sort of thing so it's not an issue.
1
Huh. Guess I'm not sure what exactly it's optimizing.
1
from my understanding, it was hoisting unshare() calls out of loops when assigning an Array to another variable and mutating
2
Replying to
maybe you know a little birdie who could inform us all :) I may be wrong here and would love to know if so!
Replying to
Check this thread out -- related to the discussion we were having: devforums.apple.com/message/107236
1

