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 15:18:29 -0700	[thread overview]
Message-ID: <086da1ef-79dd-448d-b463-01895df2866f@eastlink.ca> (raw)
In-Reply-To: <8d597bb5-39c8-4544-ad1a-907a79bf4cba@app.fastmail.com>

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



On 2024-05-05 13:14, Lawrence Velázquez wrote:
> Nonsense. There is no universally desired sort. It depends entirely on 
> what the application needs.
Naturally, but I expect that when we are sorting numbers, '2' should 
come before '10' most of the time.  No not 'everybody' but ... sheesh, 
I'm just saying that I'm glad that '(n)' gives me what I'd call version 
sort.  That's all.  Can't I be satisfied?
> I don't see this behavior.
> ...
> 	aaa,3,pard
> 	aaa,3a,pard
>
8 /aWorking/Zsh/Source/Wk/Boneyard 1 % var=( aaa,3*(nN) ); print -l $var
aaa,3a,pard
aaa,3,pard

... I don't know what to say.

8 /aWorking/Zsh/Source/Wk/Boneyard 1 % var=( aaa,6*(nN) ); print -l $var
aaa,6
aaa,6,    # sixth char ',' precedes sixth char 'a'
aaa,6a
aaa,6a,
aaa,6a,howdy # sixth char 'a' precedes sixth char ','
aaa,6,howdy

It's not how I understand sorting but I don't doubt there is some method 
to it.  'sort' does the same.  'sort' has been around a long time so I 
don't doubt that what it does is very well thought out whether it makes 
sense to me or not.   Version sort is not a strict 'dictionary' sort, it 
'interprets', so the above does what it thinks best.  I would have expected:

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

... but that's not the way it is. Not worth worrying about.

vmlinuz-6.1.0-20-amd64

... that's my Linux version, the algorithm for sorting such versions 
must be a bit arbitrary.  I'm not complaining.





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

  reply	other threads:[~2024-05-05 22:19 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 [this message]
2024-05-05 23:26           ` Lawrence Velázquez
2024-05-06  1:51             ` Ray Andrews
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=086da1ef-79dd-448d-b463-01895df2866f@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).