emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 71783e9: Add the string-numeric-lessp function


From: Lars Ingebrigtsen
Subject: Re: master 71783e9: Add the string-numeric-lessp function
Date: Mon, 22 Feb 2016 15:00:42 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> Not quite sure I'm following. Every string is a version string.

I don't think I agree with that.  All version strings are strings,
though.

>> And is this supposed to be this way?
>>
>> (string-version-lessp "foo001.png" "foo1.png")
>
> Yes, if the version numbers and everything else result in a tie, it
> falls back on straight lexicographic comparison. Having the function
> be anything other than a total order would cause problems in sorting
> functions that use it to compare.

That sounds fine for version numbers, but is not what we want when
sorting file names, I think.

> Oh, and in response to one of your other questions: this function
> should be useful for package versions as well as file names. For
> example, I recently updated my libc-bin version on Ubuntu from
> 2.21-0ubuntu4 to 2.21-0ubuntu4.1 as part of the getaddrinfo security
> update.

I don't think that's something our numerical string comparison function
should be doing.  This version string thing sounds very much geared
towards version strings, and that's fine.  Using that function for
anything else seems increasingly odd.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]