zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: How to impose a numeric sort on negative numbers?
Date: Wed, 1 Jul 2020 20:07:53 +0200	[thread overview]
Message-ID: <CAKc7PVDwTCnaDNcQhkpjJkhMRuVyfB8eaGLUUKr=VHYJ=rzp2Q@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3T8YxuNMWUhoGNiY6NReQdOKPdcmeS6jo13iSMsAt44OA@mail.gmail.com>

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

It's weird  that it's different - could you share `allopt' output?

And it's not correct - -1 is before -3, etc.


On Wed, 1 Jul 2020 at 20:03, Mikael Magnusson <mikachu@gmail.com> wrote:

> On 7/1/20, Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
> > Hi,
> > arr=( -1A -2b -3B 0 1A 2C 3B )
> > print -rl ${(on)arr}
> >
> > Output:
> > 0
> > 1A
> > -1A
> > -2b
> > 2C
> > 3B
> > -3B
> >
> > So it's not "correct". How to sort from -3 to 2?
>
> Works fine here,
> % arr=( -1A -2b -3B 0 1A 2C 3B )
> % print -rl ${(on)arr}
> -1A
> -2b
> -3B
> 0
> 1A
> 2C
> 3B
>
>
> --
> Mikael Magnusson
>


-- 
Sebastian Gniazdowski
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org

  reply	other threads:[~2020-07-01 18:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 17:45 Sebastian Gniazdowski
2020-07-01 18:02 ` Mikael Magnusson
2020-07-01 18:07   ` Sebastian Gniazdowski [this message]
2020-07-01 18:12     ` Roman Perepelitsa
2020-07-03 18:12     ` Lewis Butler
2020-07-03 18:35       ` Bart Schaefer
2020-07-01 19:42   ` Peter Stephenson
2020-07-02 11:36     ` Daniel Shahaf
2020-07-02 12:00       ` Peter Stephenson
2020-07-03 16:21         ` Hyphens, minuses, and dashes (was: Re: How to impose a numeric sort on negative numbers?) Daniel Shahaf
2020-07-02 15:46       ` How to impose a numeric sort on negative numbers? Bart Schaefer
2020-07-03 20:08         ` Peter Stephenson
2020-07-03 20:15           ` Bart Schaefer
2020-07-03 22:23           ` Daniel Shahaf
2020-07-07 16:14             ` Daniel Shahaf
2020-07-07 16:18               ` Daniel Shahaf
2020-07-01 18:48 ` Lawrence Velázquez
2020-07-06  7:15   ` Sebastian Gniazdowski

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='CAKc7PVDwTCnaDNcQhkpjJkhMRuVyfB8eaGLUUKr=VHYJ=rzp2Q@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=mikachu@gmail.com \
    --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).