Jens: Why? There are significant benefits to value semantics for this type of problem, for the reasons laid out in the WWDC videos. It would be helpful to know why you disagree in this case—maybe there are solutions to the issues you’re thinking of.
Rick: I’d think that value semantics would be the right choice here. When you do a mutation, you would copy the state of the entire diagram. It should be efficient via COW, but if not you can implement you own more fine-grained COW types with isUniquelyReferenced(). This would allow you to easily support things like undo. Jack > On Aug 1, 2016, at 4:32 PM, Jens Alfke via swift-users > <swift-users@swift.org> wrote: > > >> On Aug 1, 2016, at 1:19 AM, Rick Mann via swift-users <swift-users@swift.org >> <mailto:swift-users@swift.org>> wrote: >> >> It seems like reference semantics are more appropriate here. > > Yes, they are. (Just because structs exist doesn’t mean you have to use them > everywhere.) > > —Jens > _______________________________________________ > swift-users mailing list > swift-users@swift.org > https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users