zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: nesting issue
Date: Sun, 5 May 2024 18:51:39 -0700	[thread overview]
Message-ID: <6cfb08f8-ee3d-40fa-be88-cb10882bc1d0@eastlink.ca> (raw)
In-Reply-To: <58741215-7c41-4230-8eb5-6556bd969140@app.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]



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.


[-- Attachment #2: Type: text/html, Size: 2597 bytes --]

  reply	other threads:[~2024-05-06  1:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04 19:36 Ray Andrews
2024-05-05  3:20 ` Bart Schaefer
2024-05-05  5:39   ` Lawrence Velázquez
2024-05-05  5:40   ` Roman Perepelitsa
2024-05-05 13:52     ` Ray Andrews
2024-05-05 20:14       ` Lawrence Velázquez
2024-05-05 22:18         ` Ray Andrews
2024-05-05 23:26           ` Lawrence Velázquez
2024-05-06  1:51             ` Ray Andrews [this message]
2024-05-06  3:22               ` Bart Schaefer
2024-05-06 13:01                 ` Ray Andrews
2024-05-06  3:43               ` Lawrence Velázquez
2024-05-06 13:09                 ` Ray Andrews
2024-05-05 13:13   ` Ray Andrews
2024-05-05 19:44     ` Lawrence Velázquez
2024-05-05 20:14       ` Ray Andrews
2024-05-05 20:45         ` Lawrence Velázquez
2024-05-05 22:22           ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6cfb08f8-ee3d-40fa-be88-cb10882bc1d0@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).