[swift-users] Are value semantics really appropriate in a diagramming app?

Rick Mann rmann at latencyzero.com
Mon Aug 1 04:29:43 CDT 2016

> On Aug 1, 2016, at 02:25 , Rimantas Liubertas <rimantas at gmail.com> wrote:
> I did. That's one of the two talks I mentioned.
> Well, so they did cover this, didn't they? You move item, you get the new struct with the new position. And if you save the old one, you have a cheap way to implement undo.

That's the other problem, undo. Presumably, the copy-on-write semantics make this form of undo efficient, both in terms of making the copy for each operation, and in terms of the amount of memory required (because only fine-grained copies are made). But if the model is large and complicated, I'd be worried about the performance implications of this.

Maybe I'll try it, see how it works.

Rick Mann
rmann at latencyzero.com

More information about the swift-users mailing list