On Tue, Dec 16, 2008 at 6:05 PM, Terry Brown <[email protected]> wrote:
> I wonder if they're might be code which does its own recursion using > children_iter(), I suspect I've used that pattern in places... > > def doSomething(p): > > for c in p.children_iter(): > # do something using p and c together, then > doSomething(c) This is in essence what leoQtTree.drawChildren does. It would be a mistake to second-guess how iterators will be used. They must work as expected whenever possible. It's up to the user of the iterator, not iterator itself, to handle boundary conditions. Status report for the graph-world-2 branch: You can move clones anywhere, but writing such a file is not recommended :-) My first attempt at the tree draw code draws too much or too little. I think more is needed than p.isBackLinkOf(p2). Perhaps p.isAncestorOf(p2) must be changed. Or used. BTW, the drawing code doesn't actually use iterators. Instead it uses the p.moveToNext method, which should be equivalent to the children_iter. I'm excited about this. I think the code will be clean, once I figure out what the real problems are. I don't see anything resembling a gotcha. Edward --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
