From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#58168: string-lessp glitches and inconsistencies Date: Sat, 1 Oct 2022 21:57:45 +0200 Message-ID: References: <7824372D-8002-4639-8AEE-E80A6D5FEFC6@gmail.com> <83czbef6le.fsf@gnu.org> <6CB805F6-89EE-4D7C-A398-F29698733A42@gmail.com> <83h70oce4k.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26279"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58168@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 01 21:58:09 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oeicj-0006h2-2k for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Oct 2022 21:58:09 +0200 Original-Received: from localhost ([::1]:43516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeici-0002Ml-6D for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Oct 2022 15:58:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeicc-0002MX-P0 for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2022 15:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oeicc-0001YT-GT for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2022 15:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oeicc-0000ao-63 for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2022 15:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Oct 2022 19:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58168 X-GNU-PR-Package: emacs Original-Received: via spool by 58168-submit@debbugs.gnu.org id=B58168.16646542752265 (code B ref 58168); Sat, 01 Oct 2022 19:58:02 +0000 Original-Received: (at 58168) by debbugs.gnu.org; 1 Oct 2022 19:57:55 +0000 Original-Received: from localhost ([127.0.0.1]:45737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeicV-0000aT-4N for submit@debbugs.gnu.org; Sat, 01 Oct 2022 15:57:55 -0400 Original-Received: from mail-lj1-f173.google.com ([209.85.208.173]:34502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeicT-0000aF-1T for 58168@debbugs.gnu.org; Sat, 01 Oct 2022 15:57:53 -0400 Original-Received: by mail-lj1-f173.google.com with SMTP id bs18so6481103ljb.1 for <58168@debbugs.gnu.org>; Sat, 01 Oct 2022 12:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date; bh=zI6vJUvs0K2UptNH6QvI3pe9mrg0gcYFWfTnVLyxcYw=; b=LlMWSCfis4ycINfkCoXrAgD1KhGTGFqTPpzFF1gHM0nRueDaXNMi3jPyto0gpOftu/ 3bSzLIQbTOkzm2Ot5Sv7NILgC6WzYSfKGqYzpBQUjkvWhY7wXhlqpbYJkqd97JsP8T/w 6RWOk/p2EV6yAZSJ3C1VvhvymXazhWqKlfPuzEQtd2WJgNtAOZGdHO0dTbrZp6JAQACK T+kJWOHJwWFLBkZcnKUqORNh4CsBMIel92yDVfv12RSgIRpxMN5IF16h8M/WnAuZP13V 76yGvR8lbaO8toHM8jYZZ8CSA3GPBiM53ddQZqgB8EM3QzVsRzkJQEFdJMcwXFa6z3iD K5vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date; bh=zI6vJUvs0K2UptNH6QvI3pe9mrg0gcYFWfTnVLyxcYw=; b=W4mzHsoC/rcmA11b2e/DUGncfvkAGkxdhuqwCjRFr63Kr4tEULS7EaVZTRPDFcwtDF 464mjpnuysWyeYnzJPvBgI5SUW24Tk8ZvGybz3SE6l1jYc7HB48n9GEm1r1OnKmEzwCa XyhgYrvEbA4Zy7Mncw77hZYEebwvNhCR0wwupvPQ/GHsQNsKRNOceec6GTAVVXlVWun+ ZVVzgwa75mQPG8yMMgmQ+Hdm0PCaHzQNhMswPmgIqVnqDbFXpBZk0u1svbvJzXA0wcRM BywmWQIJO6BuTyjiUfFvt/l1xCKrGVmlUsVJNF39E1Mt3sa7OCG6/V6vsU2iExILeKPl 9twA== X-Gm-Message-State: ACrzQf3vYcu8Aqf15YuFqey4L6C3lgxIjAR3CI2AMCzVS/NGqpm7JETv cGShwjvPqn0dnM9JG1jPQ0E= X-Google-Smtp-Source: AMsMyM5hoCkld9Nu+nbsNKbvwiTVShVoTFJy3+p3DljljrYqPQ65IwN1rRZx7Ifw5VEuH8F9kz3mMg== X-Received: by 2002:a2e:3211:0:b0:261:c5c8:3403 with SMTP id y17-20020a2e3211000000b00261c5c83403mr4684364ljy.86.1664654266724; Sat, 01 Oct 2022 12:57:46 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se. [188.150.171.209]) by smtp.gmail.com with ESMTPSA id bi9-20020a0565120e8900b0048b08e25979sm842407lfb.199.2022.10.01.12.57.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Oct 2022 12:57:46 -0700 (PDT) In-Reply-To: <83h70oce4k.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244161 Archived-At: 1 okt. 2022 kl. 07.22 skrev Eli Zaretskii : > It depends on the use case, but in general I see no problem with > signaling errors when we cannot produce reasonably correct results. > For example, string-to-unibyte does signal an error in some cases. That's fine because that function is documented to do so and always has, = but making previously possible comparisons raise errors shouldn't be = done lightly. Comparison between objects is not only useful when someone cares about = their order, as in presenting a sorted list to the user. Often what is = important is an ability to impose an order, preferably total, for use in = building and searching data structures. I came across this bug when = implementing a string set. >> It's also a matter of performance -- string< has been improved = recently but currently we compare text in Latin and Swahili much faster = than French and Arabic; it would be nice to close that gap. UTF-8 is = designed so that comparing strings by scalar values can be done = byte-wise, but the way we encode raw bytes make them sort right between = ASCII and Latin-1. Given that the specific order doesn't matter much, we = could just run with that. >=20 > I see no reason to make comparison of unibyte and multibyte strings > perform better. Actually I was talking about multibyte-multibyte comparisons. You were probably thinking about comparisons between unibyte strings = that contain raw bytes and multibyte strings, and those are indeed not = very performance-sensitive. However there is no way to detect whether a = unibyte string contains non-ASCII chars without looking at every byte, = and comparing unibyte ASCII with multibyte is definitely of interest. = Strings are still unibyte by default.