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

Re: How to impose a numeric sort on negative numbers?



Peter Stephenson wrote on Wed, 01 Jul 2020 20:42 +0100:
> +++ b/Doc/Zsh/expn.yo
> @@ -1097,6 +1097,11 @@ are sorted before those with fewer or none.  Hence the array `tt(foo1 foo02
>  foo2 foo3 foo20 foo23)' is sorted into the order shown.
>  May be combined with `tt(i)' or `tt(O)'.
>  )
> +item(tt(DASH()))(
> +As tt(n), but a leading minus sign indicates a negative decimal
> +integer.  A solo `tt(DASH())' not followed by an integer does
> +not trigger numeric sorting.
> +)

In the texinfo build DASH() will emit _two_ hyphens, which would be
incorrect in this context.  I think both instances of DASH() should be
changed to use a literal minus sign.

The macro is defined as «DEFINEMACRO(DASH)(0)(ifztexi(--)ifnztexi(-))».

Cheers,

Daniel



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