On Sun, Apr 13, 2008 at 4:15 PM, Terry Brown <[EMAIL PROTECTED]>
wrote:

>
> So, how do you iterate through a set of clones?  You could search the
> whole tree of course, any maybe iterating through clones is uncommon
> enough that this would be ok.  Or not?


No, it's *much* easier than this.  Given a position p, p.n is the node at
that position, and p.n.children are its children.  **It doesn't matter**
whether any child is a clone or not: the traversal is the same!

Consider p.threadNext.  This is simpler than the corresponding iter.
p.threadNext visits the first child if it exists, otherwise it moves to the
parent and goes from there.  It absolutely does not matter whether any of
the nodes are clones.

All the fundamental p.moveToX methods will change, but they are no more
difficult than before, and should be simpler without the unfortunate
position stack "optimization".

Words are so tricksy.  I guess only directed graphs have children.
> Undirected graphs have a "list of places you can go to from here or
> from which you can come to here", and the position tells you from which of
> those places you came, from the current position's perspective.


We can ignore those difference for the moment.  In an undirected graph,
there is no reason not to consider all links connect to a node as that
node's children.  Iters may change: data structures (nodes) won't.

>
> I think of positions as "paths".


Yes.  A position indicates "where we came from" in a standard way.  That is,
p.stack gives the direct parents of the node p.n.


> > No, it is that simple.  In a graph world iterators define paths.
> > Everything just works.
>
> Maybe I'm jumping the gun, but I'm trying to think about how Leo could
> have internally a cyclic and possible undirected or perhaps just
> nominally directed data structure, and yet still present it as
> essentially a DAG when it's running in "DAG mode".


That's a new question.  It's not high on my list to resolve at present.

However, we can draw a general graph using the present drawing code,
provided we put an upper bound on the depth of the nodes that get shown.
This cuts off unbounded graph traversals.  Better ways may exist, but this
will do as a start.


> Again, I'm secretly rooting for undirected cyclic graphs :-) but not as a
> first step.  Nor as a default mode.
>

Unless I am very much mistaken, there is little difference between directed
and undirected graphs as far as nodes (and maybe iters) are concerned.  Imo,
there is no need to worry about such details now.  The main thing is to
demonstrate the eureka.  That will clarify a lot.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to leo-editor@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to