From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69709: `sort` interface improvement and universal ordering predicate Date: Thu, 21 Mar 2024 15:54:31 +0100 Message-ID: References: <86zfv6uqjn.fsf@gnu.org> <4391448A-C7AF-4D7F-8866-C0313956D52D@gmail.com> <8366111E-97C4-4839-AA1E-A577C81A6035@gmail.com> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23154"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 69709@debbugs.gnu.org, Gerd =?UTF-8?Q?M=C3=B6llmann?= , Eli Zaretskii , Stefan Monnier , Dmitry Gutov 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 Thu Mar 21 15:55:38 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 1rnJpR-0005ls-WC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Mar 2024 15:55:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnJpE-0001cx-CS; Thu, 21 Mar 2024 10:55:24 -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 1rnJpC-0001cE-Dd for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 10:55:22 -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 1rnJpC-0000g9-5I for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 10:55:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rnJpq-0001OA-44 for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 10:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Mar 2024 14:56: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.17110329175273 (code B ref 69709); Thu, 21 Mar 2024 14:56:02 +0000 Original-Received: (at 69709) by debbugs.gnu.org; 21 Mar 2024 14:55:17 +0000 Original-Received: from localhost ([127.0.0.1]:37051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnJp7-0001Mz-3C for submit@debbugs.gnu.org; Thu, 21 Mar 2024 10:55:17 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:58744 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnJp4-0001Mq-RW for 69709@debbugs.gnu.org; Thu, 21 Mar 2024 10:55:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1711032874; bh=qJm05GgggxNJbCGJG00vtYteF2VZvT8d6cjfbWcZ3NA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AiQa5c6pNYEpAhdiQzebcFgOJ6ScKnqpBGWNo4WMn9iDrQ58nF4+FoCc+Ohj7hwhJ 86nXJaAfQu4hY1Ka6/WtQV7Lkibi4iwNUovpCg+yBKMXvo69qtiyjuYMHUKSW7aEmh C8Y9ZQacZ0bEyfZQsCQxQ6IWG2Hi8eEdKuRSqed0RVbAWUwDXDAyvfbdh/GOT7wu0X szUk95o5Fxhl1qWCuz65+Noa6Kjom37o1IJnDCN3JxhjzQQFXRUiMKGAV2BHRG2zLu HrKYsUwj0luTGAE5Qlgl0W8XJQ2FEzXRw+dqaZGv9e5sXjLQcA9i++XPDi26uBooUq KaMJmJL7gmyyw== In-Reply-To: <8366111E-97C4-4839-AA1E-A577C81A6035@gmail.com> ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Wed, 20 Mar 2024 20:01:39 +0100") X-Hashcash: 1:20:240321:monnier@iro.umontreal.ca::++wP6CsOQLfYqX+r:1NGs X-Hashcash: 1:20:240321:gerd.moellmann@gmail.com::ugmCKSkCZ3nyRu5l:0eIE X-Hashcash: 1:20:240321:dmitry@gutov.dev::t4vc/GlQHV+y6Xb9:0xG1 X-Hashcash: 1:20:240321:69709@debbugs.gnu.org::GsU61g1Xll+u6qEj:9sYR 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:281906 Archived-At: Hi, Mattias Engdeg=C3=A5rd writes: > Now the origin/scratch/sort-key branch contains a draft proposal. Summary: > > * Our timsort has now the key function handling from the original code (p= orted to Emacs). > * New keyword-based calling convention for `sort`. The old one is still t= here and works as before. > * New `value-less-p` universal ordering predicate. > * No manual updates yet. > * NEWS entries are there. > * `sort-on` is now completely superfluous (slower, less convenient) and s= hould be removed. In case it hasn't already been mentioned, AFAICT this also applies to `minibuffer--sort-by-key` (which is very similar to `sort-on`). > * Performance seems fine from initial tests. More comprehensive benchmark= ing will be done. > > Some things that I haven't made up my mind about: > > * Better name for `value-less-p`: > value< > {generic,universal,standard,lisp}{-less-p,<} > > * Maybe the :destructive keyword be called :inplace or :in-place instead?= Shorter, less violent. > > * Should the :reverse keyword be called :reversed or even :descending ? > > * Internally, `value-less-p` computes a 3-way result; it would be easy > to expose that to Lisp as `value-compare`, could be useful. > > * The design space for `value-less-p` is vast: the current code is an > attempt at intuitive semantics without too much complexity. Perhaps the "standard order" of Prolog terms programs could be an interesting reference: https://www.swi-prolog.org/pldoc/man?section=3Dstandardorder Best, Eshel