|
|
|
|
|
by sly010
1544 days ago
|
|
Particularly the "parent-child" example feels like a non issue to me. You probably want to keep multiple versions of a glyph anyway to support things like undo, in which case explicit parent update is a requirement, not an annoyance. No reason you can't have both: g2 = updateGlyph(g1)
f2 = updateFontInGlyph(f1, g2)
|
|
There are ways to achieve such "automatic updating" of items in a functional data structure, but you need to build them explicitly instead of relying on the runtime, which gives you more responsibility but also more control. The most direct approach as compared to imperative code would be to build the data structure on top of mutable state-based streams, though there are other possibilities like monotonic or immutable structures.
https://blog.waleedkhan.name/monotonicity/