On Mon, 14 Apr 2008 16:52:48 -0500
"Edward K. Ream" <[EMAIL PROTECTED]> wrote:
> > The other suggestion was outlined by you and Terry in the
> > parallel thread: to somehow annotate the position during a
> > traversal of the tree. You call that easy, but then you are a
> > programmer.
>
> I strongly suggest not going in this direction. It's really, really
> ugly, and it will not be easy to do correctly.
Actually I wasn't suggesting "annotating the position", but rather just
iterating through p.stack (which in unified node world will make more
sense) to determine context.
But now that you mention "annotating the position" it seems that there
might be uses for callbacks invoked by a position as it moves through
the tree. I'm not sure it would achieve anything you couldn't do by
iterating p.stack, but it might save time.
A
B
C
D
E
If a position gets to D and it has called a registered callback at each
step (with itself as an argument, no doubt) it could already contain
information collected from A, B, and C on the way, instead of
collecting information from A, then A and B, then A and B and C, then
A-D, as would be the case with iterating p.stack.
There'd need to be some invocation of the callback as the position
moved back up, so that B,C,D info. could be dumped when you get to E.
Of course this is all assuming too much about how iterators work with
positions without checking the code, but I think it's interesting in
the context of, er, context.
> I just don't see how I can be wrong about this. In my eyes, you are
> misusing clones so that they appear differently in different contexts.
Cleo does a similar thing, although changing it probably wouldn't have
any noticeable impact on cleo. I think using vnodes to distinguish
context has been an obvious, even if unintended, choice, up to now.
Positions have evolved to more important and sophisticated entities
over time.
Cheers -Terry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---