On Wednesday, December 11, 2013 11:13:05 AM UTC-6, Edward K. Ream wrote:
 

> Clearly, without sentinels there is no *perfect* way to associate clones 
> in a .leo file with text in an @auto file.  In the worst (general) case, 
> Leo might issue a warning about broken clones.  That can't be helped.
>

 The above will always be true.  But there is a good  workaround!

In the present world, sentinels carry the identity of each node in the 
so-called gnx, the global node index.  This is a permanent, immutable, 
intrinsic property of each node.

But suppose we simply say that the identity of each node in an @auto tree 
is its headline?  This might work!

1. The headline is quite an excellent proxy for true identity.  It will 
change much less often than body text.  Indeed, you could say that changing 
the name of a class, method or function does *in fact* change the objects 
identity!

2. It will be rare, in practice, for two nodes (in an @auto node) to have 
the same headline.

True, if Nancy changes the name of a class, method or function, clone links 
will break when Leo reads the file. But broken clone links will *always* be 
a possibility--this scheme seems like the least bad option.

Furthermore, this scheme requires no cooperation from Nancy, and uses no 
hidden markup or other "tricks".  It has real promise.

Edward

P.S.  Now seems like the time to mention something very important about 
clones: they are *exactly* like other nodes!  Clones just have more than 
one link from a parent node to them.  That's *all*.

It's important to keep this firmly in mind.  The problem with clones does 
not, in fact, have *anything* to do with a node being a clone.  Instead, 
the problem is, first and only, the problem of establishing the *identity* 
of text in an external file created with @auto.  Without gnx's (in 
sentinels) there is no *foolproof* way of establishing identity.

That's why using headlines as proxies for identity in @auto trees has such 
appeal.  Not only is it simple, but the @auto import algorithm creates 
headlines from *fundamentally important* data, that is, the name of a 
class, method or function.  It's hard to imagine any other data which would 
be a better candidate for a node's identity.  If an object's name changes, 
then it is *reasonable* to say that it's identity has changed.  In that 
case, broken clone links simply reflect the fact that there is no longer an 
object with the given name/identity!

All in all, a very good day.  And a surprising one.

EKR

-- 
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