Sentinel Naming Convention

126 views
Skip to first unread message

k-hen

unread,
Aug 17, 2020, 8:40:18 AM8/17/20
to leo-editor
Hi All,

This is low priority, just thought I'd ask if perhaps there's a way to configure the sentinel naming system. I'll probably keep using @clean, but I'd be much more likely to use @file & sentinels if they were a *hash* or custom specified instead of my name/date.

Thanks,
Kevin



Edward K. Ream

unread,
Aug 17, 2020, 9:59:56 AM8/17/20
to leo-editor
On Mon, Aug 17, 2020 at 7:40 AM k-hen <percepti...@gmail.com> wrote:
Hi All,

This is low priority, just thought I'd ask if perhaps there's a way to configure the sentinel naming system. I'll probably keep using @clean, but I'd be much more likely to use @file & sentinels if they were a *hash* or custom specified instead of my name/date.

This is unlikely ever to happen. The name/date is actually a gnx (global node index), which must be unique and invariant. gnx's make Leo's clones possible, and reliable.

Edward

Thomas Passin

unread,
Aug 17, 2020, 10:05:31 AM8/17/20
to leo-editor
You could, however, use a new meaningless user name in Leo.  That should have the effect you want.  It will still have the date, but the name wouldn't disclose anything.

percepti...@gmail.com

unread,
Aug 17, 2020, 7:29:07 PM8/17/20
to leo-e...@googlegroups.com
True, but maybe *someday* a GUID/UUID or a Hash of that gnx - something like: http://cyan4973.github.io/xxHash/ or https://github.com/google/farmhash 
--
You received this message because you are subscribed to a topic in the Google Groups "leo-editor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leo-editor/g-Dl-g4S13s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/948b2edf-ea56-4ec4-9376-ab45c2589127o%40googlegroups.com.

Thomas Passin

unread,
Aug 17, 2020, 8:27:29 PM8/17/20
to leo-editor
For that matter, Python already has a fast hash function.  It hashes dictionary keys, for one thing, and dictionaries are essential to Python.


On Monday, August 17, 2020 at 7:29:07 PM UTC-4, k-hen wrote:
True, but maybe *someday* a GUID/UUID or a Hash of that gnx - something like: http://cyan4973.github.io/xxHash/ or https://github.com/google/farmhash 




On Mon, 2020-08-17 at 07:05 -0700, Thomas Passin wrote:
You could, however, use a new meaningless user name in Leo.  That should have the effect you want.  It will still have the date, but the name wouldn't disclose anything.

On Monday, August 17, 2020 at 9:59:56 AM UTC-4, Edward K. Ream wrote:


On Mon, Aug 17, 2020 at 7:40 AM k-hen <percepti...@gmail.com> wrote:
Hi All,

This is low priority, just thought I'd ask if perhaps there's a way to configure the sentinel naming system. I'll probably keep using @clean, but I'd be much more likely to use @file & sentinels if they were a *hash* or custom specified instead of my name/date.


This is unlikely ever to happen. The name/date is actually a gnx (global node index), which must be unique and invariant. gnx's make Leo's clones possible, and reliable.

Edward
--
You received this message because you are subscribed to a topic in the Google Groups "leo-editor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leo-editor/g-Dl-g4S13s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leo-e...@googlegroups.com.

Edward K. Ream

unread,
Aug 18, 2020, 8:35:39 AM8/18/20
to leo-editor
On Mon, Aug 17, 2020 at 6:29 PM <percepti...@gmail.com> wrote:

> maybe *someday* a GUID/UUID or a Hash of that gnx

Let me be clear. I would vote against this proposal, for the following reasons:

1. user-id + timestamp is useful information. Imo, a distinct user id, say the user's github id, is required to ensure unique gnx's. There has been a long, technical, discussion of this.

2. Any change to gnx format would amount to a change in supported external files. Any such change would make it impossible for old versions of Leo to read @file nodes. This is a big deal.

In short, the supposed advantages, such as they are, do not come close to justifying a big change to Leo.

Edward

k-hen

unread,
Aug 18, 2020, 8:26:54 PM8/18/20
to leo-editor
Those are all valid points. In fairness, I think this could be a separate _option_ without affecting existing documents but I see your point.
FWIW, in the database world it's generally best not to expose primary keys, so you'd have both an internal id and a public one which would be mapped.
Alternatively, a few languages let you specify #region tags that work specifically for folding so that could work too (someday).

I understand this would be a major change to Leo though are that there are higher priority things to do, just thought I'd mention it anyway for future reference :-)

Thanks.

k-hen

unread,
Aug 21, 2020, 10:38:11 AM8/21/20
to leo-editor
I know this issue has been put to bed and is extremely unlikely to happen, but just one more thing:
If I had a magic wand:

I could add a decorator to *alias* a node's gnx, so the gnx could stay as-is, but I could give it an alternate/external name as well.
So if/when the file write happens it would use the alias if there was one and the gnx if there wasn't, which could be easily coalesced and both globally unique.
Then I'd feel more comfortable, even encourage, scattering // <comments> throughout the code.
Also, any existing files using gnx would be unaffected.

Furthermore, I have Leo support universal file handlers so I those could be leo://fileref:urls which would open leo to the appropriate node from those comments.

Anyway, just thought I'd mention it, maybe someday I'll try to dive into this.

Edward K. Ream

unread,
Aug 21, 2020, 12:53:30 PM8/21/20
to leo-editor
On Fri, Aug 21, 2020 at 9:38 AM k-hen <percepti...@gmail.com> wrote:

I know this issue has been put to bed and is extremely unlikely to happen, but just one more thing:
If I had a magic wand:

I could add a decorator to *alias* a node's gnx, so the gnx could stay as-is, but I could give it an alternate/external name as well.

Let me encourage you to think about Leonine scripts and uA's, rather than extensions to Leo. The combination might blow your mind :-)

You can probably do what you want now. You don't need my approval and you won't have to wait for upgrades. 

Edward

k-hen

unread,
Aug 21, 2020, 2:46:37 PM8/21/20
to leo-editor
Intriguing ... can't wait!
Reply all
Reply to author
Forward
0 new messages