From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: master 71783e9: Add the string-numeric-lessp function Date: Sun, 21 Feb 2016 16:36:30 +1100 Message-ID: <87oabafwv5.fsf@gnus.org> References: <20160221043348.25201.81719@vcs.savannah.gnu.org> <87twl2fzaw.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456033062 9703 80.91.229.3 (21 Feb 2016 05:37:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Feb 2016 05:37:42 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 21 06:37:31 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aXMi0-0000d7-4f for ged-emacs-devel@m.gmane.org; Sun, 21 Feb 2016 06:37:28 +0100 Original-Received: from localhost ([::1]:38274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXMhw-0004cD-5L for ged-emacs-devel@m.gmane.org; Sun, 21 Feb 2016 00:37:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXMhh-0004c3-Tp for emacs-devel@gnu.org; Sun, 21 Feb 2016 00:37:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXMhd-0003S3-VF for emacs-devel@gnu.org; Sun, 21 Feb 2016 00:37:09 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:48140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXMhd-0003Rz-OS for emacs-devel@gnu.org; Sun, 21 Feb 2016 00:37:05 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aXMhA-0007sz-6c for emacs-devel@gnu.org; Sun, 21 Feb 2016 06:36:36 +0100 In-Reply-To: <87twl2fzaw.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 21 Feb 2016 15:43:51 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aXMhA-0007sz-6c MailScanner-NULL-Check: 1456637797.44489@LaayB5y8eWbEo8YPVnhb1A X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200361 Archived-At: Lars Ingebrigtsen writes: > There has to be a simple way to do that check... hm... I see that > `string-to-number' uses strtoumax... Hm... perhaps I can rewrite this > function to use that instead... The code almost got simpler, even. `string-numeric-lessp' now reverts to calling `string-lessp' if any of the embedded numbers overflow size_t. I think that should be OK for any real world usages... I mean, even that could be fixed if we want to be really picky, but I'm not sure it's worth it. (The fix would be: If the numerical stretches are of unequal length, then obviously the shorter one is smaller than the longer. If they're of equal length, then we can just compare the numerical stretches lexicographically. So we don't really really need to convert anything to numbers, anyway...) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no