From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#69709: `sort` interface improvement and universal ordering predicate Date: Sun, 10 Mar 2024 18:03:31 +0200 Message-ID: <0e13de8a-ab0c-404d-9d93-d3756abcfa43@gutov.dev> References: <0A9CE0FD-AE2D-462C-906D-567F331CC98B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10339"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 69709@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 10 17:04:46 2024 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 1rjLfJ-0002O9-BM for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Mar 2024 17:04:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjLf7-0000hx-4G; Sun, 10 Mar 2024 12:04:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjLf3-0000hW-7b for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 12:04:29 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjLf2-0004wP-VH for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 12:04:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjLfa-0005Wb-7c for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 12:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 16:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69709 X-GNU-PR-Package: emacs Original-Received: via spool by 69709-submit@debbugs.gnu.org id=B69709.171008665721174 (code B ref 69709); Sun, 10 Mar 2024 16:05:02 +0000 Original-Received: (at 69709) by debbugs.gnu.org; 10 Mar 2024 16:04:17 +0000 Original-Received: from localhost ([127.0.0.1]:37755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjLeq-0005VP-AZ for submit@debbugs.gnu.org; Sun, 10 Mar 2024 12:04:17 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:50975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjLen-0005Uy-7P for 69709@debbugs.gnu.org; Sun, 10 Mar 2024 12:04:15 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4716C5C0052; Sun, 10 Mar 2024 12:03:33 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 10 Mar 2024 12:03:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1710086613; x=1710173013; bh=iReCDhY+qmvv228xs2uYHt+f4Y4sG+nRZlZq/QuxNDA=; b= DRllf6LPKginNlzSFReXPfhUQzYQaXVX6S8S/YAN5ucy3c6dUfU70OUHcRkLyaFN IlI3XzrHzdmopafLi/yuFicP+PW3WFkIDsPdX6Thl/ohX/BqaWEgvVn5Pu1dREbw t9KOnNqEqXv2nDNCmJR+ruLUfV54v68+y5AhCFdq1rn0MSvsi3bh9gRluXw1/gH2 qrjJXTIHvR16aKKeEz7c8NEXI8c8zBxS+vO5o77rqezPfFweEf3J6B11Fz7wrUjZ M9MqGkCqxnw8qsONYlCx7XmnXWiylVotZrxiQRQVz4H83wMmLbCZVmkF60Q7eENN 42WU/rN+naFirvIZwOf80g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1710086613; x= 1710173013; bh=iReCDhY+qmvv228xs2uYHt+f4Y4sG+nRZlZq/QuxNDA=; b=M cQO8lCjCaid0I0Q7mazvH6m14qpWEu7TQNyGUSB9MalMnYupHx1bVQ625kgbsVH9 oe+YNgKYdlcVO3k5IAvtUZqu7UoAXtajar7+60BeZATr/1KD0T3e5sKaWP1f9U+6 Z3VMHfuITNgNATaDCV982b2ZsRO/tOLHUl18f1KiFN2Y7hakY+vCZLNyd2xP+XtU 3BSjj7QwmNOKcL1Nna27ubUMMr9h/lLOR311416+6JmIiUBHUtQPjSJMlhw8eLEq K0helsYIHUqdyUdOd29LI1qUj3r6/F5balQn75r3ml4IBV6LSxa7eIJ7IZN7I5/9 gggSmmo1+a5V8P1D9Oh7A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieelgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeegleefteekgffhvdfhtdegveevveetteegteevgeettdehhfdukeetheffueek keenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 10 Mar 2024 12:03:32 -0400 (EDT) Content-Language: en-US In-Reply-To: <0A9CE0FD-AE2D-462C-906D-567F331CC98B@gmail.com> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281405 Archived-At: On 10/03/2024 17:56, Mattias EngdegÄrd wrote: > 10 mars 2024 kl. 16.48 skrev Dmitry Gutov: > >> Here's a concern: a lot of existing code is written with either mutability in mind (the source list is a throwaway one, owned by the caller), or coupled with copy-sequence already. >> >> If the new 'sort' default to non-destructive, wouldn't that make those existing callsites slower? Or at least some of them. > No, with the old calling convention they would get destructive (in-place) sorting. There should be no incompatibilities at all. I see. That sounds more confusing, though (you drop the 'pred' argument, and the function changes behavior, possibly becoming slower too).