3 ms·
> Don't explicitly manipulate your data structures. Sharing will take care of keeping the overheads low. Immutability is one of the strong points of Piece Tabl
by thomastjeffery 9y ago
> Don't explicitly manipulate your data structures. Sharing will take care of keeping the overheads low.
Immutability is one of the strong points of Piece Tables.
Don't forget that this is the most simple implementation of a Piece Table. If you are in any way concerned about performance, you can quite easily implement caching, sharing, etc.
- eru 9y agoI suspect we are in violent agreement. I was just taking aim at > [...] "undo" is done by swapping the last left Leaf with an empty Leaf. Redo is done by rotating the last left node's leaves. Which is more complicated than you need to be in an immutable setting to implement undo/redo.