3 ms·
I stand corrected, thanks for the thorough answer. My interest in ropes was arisen from the "data structures for text editors" post here on HN. Most resources
by terminalcommand 9y ago
I stand corrected, thanks for the thorough answer.
My interest in ropes was arisen from the "data structures for text editors" post here on HN. Most resources were haskell implementations. IBM Developerworks had an article about ropes and a corresponding java library, the article stated ropes were immutable.
https://www.ibm.com/developerworks/library/j-ropes/index.html https://www.ibm.com/developerworks/library/j-ropes/index.htm...
I admit being wrong on every node storing a single character, that misconception stems from a graph I saw representing ropes on yesterday's article.
Undoing with immutable ropes is very straightforward I think. You don't copy the whole file, but just the references. I admit it is heavier on the memory, but you could store an arbitrary amount of previous "states" or versions in ram. The benchmark on the Java library may prove this point.
I will try to read the original article to gain more insight. Thanks again for the resources.