On Fri, May 24, 2013 at 7:23 AM, Edward K. Ream <[email protected]> wrote:
> These four methods seem to me to be the only holes in the vnode API.
I'll add these *experimental* definitions today.
Rev 5793 adds the following new vnode methods, with a *minimal* unit test::
def cloneAsNthChild(self,parent_v,n):
# Does not check for illegal clones!
v = self
v._linkAsNthChild(parent_v,n)
return v
def insertAsFirstChild(self):
v = self
return v.insertAsNthChild(0)
def insertAsLastChild(self):
v = self
return v.insertAsNthChild(len(v.children))
def insertAsNthChild(self,n):
v = self
assert 0 <= n <= len(v.children)
v2 = vnode(v.context)
v2._linkAsNthChild(v,n)
assert v.children[n] == v2
return v2
Terry, please test the insert methods. When I have time, later today, I'll
figure out what to do about bad args to v.cloneAsNthChild.
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?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.