Andy Matuschak@andy_matuschak·Jun 22, 2015But you can make it work for your types! https://mikeash.com/pyblog/friday-qa-2015-04-17-lets-build-swiftarray.html…Quote TweetDavid Smith@Catfish_Man · Jun 22, 2015Reminder that copy-on-write in Swift is a feature of Array, Dictionary, etc… not of structs in general. It’s not automatic for your types.Show this thread21139
Nacho Soto@NachoSoto·Jun 22, 2015@andy_matuschak @Catfish_Man really!? so all this time, when we’ve been saying “value semantics”, they’re not equal for all value types?21
Andy Matuschak@andy_matuschak·Jun 22, 2015@NachoSoto @Catfish_Man Huh? No, copy-on-write-ness is what’s different. That’s not part of semantics—it’s an optimization.13
Zach Gotsch@CodeAthena·Jun 23, 2015@andy_matuschak @NachoSoto @Catfish_Man I do feel a little misled. Strange to learn this on Twitter rather than in a wwdc talk.21
Andy Matuschak@andy_matuschakReplying to @CodeAthena@CodeAthena @NachoSoto @Catfish_Man I think a key thing to realize is that the compiler can elide copies often. Dynamic cases need this.2:04 AM · Jun 23, 2015·Twitter for iPhone
Zach Gotsch@CodeAthena·Jun 23, 2015Replying to @andy_matuschak@andy_matuschak @NachoSoto @Catfish_Man yeah I previously figured compiler would make decision on cow vs eager copying for all value types