Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: nesting issue





On 2024-05-05 16:26, Lawrence Velázquez wrote:
... I don't know what to say.
Seems like differing locales (which I overlooked earlier).  On
Debian 12:
Man ... I dunno, maybe the world needs different sorting logic between Canada and the US but to me it just looks like making trouble.  Anyway kudos for figuring that out.

I would have expected:
aaa,6,    
aaa,6a
aaa,6,howdy
aaa,6a,howdy
Why?
Because at least the dictionary sort proceeds left to right with each subsequent character sorted as a sub-sort within the fixed sort arrived at by previous characters.  IOW as you move right, nothing ever changes to the left.  If 'aaa,6,' precedes 'aaa,6a' then every possible expansion of 'aaa,6,' will precede every possible expansion of 'aaa,6a'. It's the same as with numbers: every 2,xxx is greater than every 1,xxx.  I suppose there's something in the version sort that interferes with that.  Mind ... (n) is not an explicit version sort, so what's the algorithm?  This gets interesting.  And ... Ooops, no, that's not what I'm expecting I'm expecting:

aaa,6,    
aaa,6,howdy
aaa,6a
aaa,6a,howdy

    ... a few more tests ... 'sort -V' is different.  But '(n)' seems
    the same as 'sort -n':

aaa,6
aaa,6,
aaa,6a
aaa,6a,
aaa,6a,howdy
aaa,6,howdy    # I'd just like to know how this ends up last. I'd expect it 3d.  Both version sort and '(n)' agree that this is last.  There will be an algorithm I'd just like to know what it is.




Messages sorted by: Reverse Date, Date, Thread, Author