On Tuesday, January 28, 2014 9:01:49 AM UTC-5, Edward K. Ream wrote:

> Debugging continues.  Good, if slow, progress yesterday:

Same again yesterday, perhaps in a round-about manner.

I spent several hours yesterday afternoon attempting a "complete" 
documentation of vc.demote, the real main line of the code.  This morning, 
when I awoke, I had the following thoughts:

1.  Nobody, me included, is ever like to read the documentation, or 
understand it even if they do read it ;-) Instead of blah, blah, blah, the 
documentation that *will* be read, and *will* be useful, are traces in 
vc.demote and helpers.  The shorter the better.

2. I realized that the concept of **anchor** is key, and that it is 
difficult to get straight.  The corresponding **anchors dict** maintains 
offsets.  The only failures with the present code involve incorrectly 
computed offsets, so organizers (existing or otherwise) get put in the 
wrong sibling position (childIndex).

In essence, the anchor for *any* node p is the parent of p **in the final 
outline**.  So the anchor of p is *not* necessarily p.parent().  Again, in 
practice, the anchor of a to-be-moved-or-inserted node is really only used 
as the key into the anchors dict, and the only reason we use the anchors 
dict is to adjust child indices so we know where to put organizer nodes in 
the final tree.  This is, truly, about all I can keep in my head at one 
time.  The details are mind numbing.

3. The plan now is straightforward: Ignore the documentation, create 
minimal tests that illustrate the bugs, get traces that illustrate the 
bugs, fix the bugs ;-)  Refactoring code that manipulates the anchors dict 
may help with traces.

That's all for now.

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