[swift-users] Are value semantics really appropriate in a diagramming app?
jens at mooseyard.com
Mon Aug 1 21:28:19 CDT 2016
> On Aug 1, 2016, at 7:24 PM, Rick Mann <rmann at latencyzero.com> wrote:
> But my model has implicit reference semantics: multiple instances of a part can share a PartDefinition; it is intended that if the PartDefinition changes, all the referencing instances get the change.
Bingo. That’s the very definition of a reference.
> On Aug 1, 2016, at 7:18 PM, Jack Lawrence <jackl at apple.com> wrote:
> 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
It sounds like you’re talking about a persistent data structure <https://en.wikipedia.org/wiki/Persistent_data_structure>, which to me is not the same thing as a value type.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users