This ENB will try to make sense of Vitalije's idea of immutable positions. Let's call them *Imps *:-) Leo's Position and VNode objects must stay as they are. However, as a *thought experiment*, we can imagine adding Imps to leo.
Don't get your hopes up. Imps are not a good idea. *What would an immutable position be?* If I understand Vitalije, an Imp would continue to exist when the outline changes. Leo could implement imps as a pair of dictionaries. One dict would associate Positions with Imps; the other would associate Imps with Positions. Immutable positions would have global position indices (*gpxs) *similar to gnxs. Leo's position class would have to keep these two dicts up to date when moving, inserting, cloning, or deleting nodes. It won't be easy, but this is a thought experiment. *What problems would Imps solve?* None, imo: - Imps may become invalid if the underlying VNode disappears. - Difficult code like *c.deletePositionsInList* doesn't get any easier. - *g.app.p_to_ap* and *g.app.ap_to_p* suffice to restore c.p on startup. - gnx-based clickable links moot the need for Imps. *Summary* Leo could (as a thought experiment) implement Imps as a pair of dictionaries. Imps would exist *in addition to* Positions and VNodes. The Position class would have to keep the dictionaries up to date. That task would not be fun. Mistakes would be catastrophic. Imps solve no urgent problem, nor do they solve existing problems more simply. gnx-based clickable links moot the need for Imps. Let's find new ways to use Leo's new clickable links! Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/7e47a044-da44-4394-b0d7-adfab2348bd1n%40googlegroups.com.
