On Mon, Jan 13, 2014 at 9:26 AM, Edward K. Ream <[email protected]> wrote:

> 
All the hard work is complete!

I am confident of this statement, even though significant work remains.
Here's why.

1. The hard part of the code involves moving nodes.

vc.global_moved_node_list is the backbone of the entire algorithm.
vc.demote_helper and its helpers add items to the list.  vc.move_nodes and
its helpers remove items from the list.  Very few significant "if"
statements exist:

Both vc.demote_helper and vc.move_nodes_to_organizers (the hard part of
vc.move_nodes) are straightforward.  Very few if statements exist:

- The "main switch" in demote_helper is likely already correct and will
have only localized consequences

- The single "if" statement in vc.move_nodes_to_organizers (the hard part
of vc.move_nodes) reflects the fundamental distinction: nodes that must be
copied vs. nodes that can be moved immediately.

2. Newly-installed traces make it clear what is happening.

This is surprisingly important.  If bugs exist, it will be easy to recreate
them using unit tests that show, in compact, easy-to-understand dumps,
exactly what is happening.

3. Everything is easy after nodes have been moved.

Just for example, remembering nodes initial (standard) headlines is easy:
just create a dict whose keys are *vnodes* and whose values are the
standard headlines.  A node's vnode does not change when the node moves, so
complications in the node-moving algorithm have *no* effect.

In short, only the node-moving algorithm (on both "sides" of the global
move list) has  any potential for nasty bugs.  The vast majority of those
bugs are gone, and will be easily fixed if any remain.  Everything else is
completely routine bookkeeping.

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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to