GNU bug report logs - #79659
30.2.50; seq-min could use value< and how about seq-argmin?

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Mon, 20 Oct 2025 07:06:02 UTC

Severity: normal

Found in version 30.2.50

To reply to this bug, email your comments to 79659 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to mattiase <at> acm.org, damien <at> cassou.me, bug-gnu-emacs <at> gnu.org:
bug#79659; Package emacs. (Mon, 20 Oct 2025 07:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Augusto Stoffel <arstoffel <at> gmail.com>:
New bug report received and forwarded. Copy sent to mattiase <at> acm.org, damien <at> cassou.me, bug-gnu-emacs <at> gnu.org. (Mon, 20 Oct 2025 07:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.2.50; seq-min could use value< and how about seq-argmin?
Date: Mon, 20 Oct 2025 09:04:57 +0200
seq-min is currently defined as (apply #'min args), which only works for
numbers.  It would be nice to redefine it to use value<.  One could also
accept a comparison function as argument, which I doubt would be useful
anymore with the advent of value<.

More interestingly, I would suggest adding a "key" or "metric" argument,
to be used, say, if you need to find the youngest person in list of
people as opposed to their age.  Apparently seq.el "doesn't do keys", so
we could instead have a new function

  (seq-argmin FUNCTION SEQUENCE)

that returns the element of SEQUENCE which minimizes the value of
FUNCTION.  An alternative name for this would be seq-min-by.

PS: To the people in CC, I believe you are the "effective maintainers"
of seq.el, let me know if I'm mistaken about that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79659; Package emacs. (Wed, 22 Oct 2025 15:53:02 GMT) Full text and rfc822 format available.

Message #8 received at 79659 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: Damien Cassou <damien <at> cassou.me>, 79659 <at> debbugs.gnu.org
Subject: Re: bug#79659: 30.2.50; seq-min could use value< and how about
 seq-argmin?
Date: Wed, 22 Oct 2025 17:52:05 +0200
20 okt. 2025 kl. 09.04 skrev Augusto Stoffel <arstoffel <at> gmail.com>:

> PS: To the people in CC, I believe you are the "effective maintainers"
> of seq.el, let me know if I'm mistaken about that.

I don't really have much to do with seq.el specifically, sorry. (I will gladly answer queries concerning value<, of course.)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79659; Package emacs. (Wed, 22 Oct 2025 16:37:02 GMT) Full text and rfc822 format available.

Message #11 received at 79659 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Damien Cassou <damien <at> cassou.me>, Augusto Stoffel <arstoffel <at> gmail.com>,
 79659 <at> debbugs.gnu.org
Subject: Re: bug#79659: 30.2.50; seq-min could use value< and how about
 seq-argmin?
Date: Wed, 22 Oct 2025 18:36:00 +0200
On Wed, 22 Oct 2025 at 17:52, <mattias.engdegard <at> gmail.com> wrote:

> 20 okt. 2025 kl. 09.04 skrev Augusto Stoffel <arstoffel <at> gmail.com>:
>
>> PS: To the people in CC, I believe you are the "effective maintainers"
>> of seq.el, let me know if I'm mistaken about that.
>
> I don't really have much to do with seq.el specifically, sorry. (I
> will gladly answer queries concerning value<, of course.)

Okay, sorry to bother :-).

I do have a random comment about value<, by the way.  I think for
records lexicographical order is not very meaningful, and instead value<
should be a generic function -- but of course not generic w.r.t. the
other built-in types (numbers, sequences, ...).  [This by the way is
consistent with my conclusion from the discussions about generics in
seq.el: defining seq methods for record types is fine, but for lists and
vectors it's misguided and shouldn't be done or even allowed.]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79659; Package emacs. (Wed, 22 Oct 2025 19:08:01 GMT) Full text and rfc822 format available.

Message #14 received at 79659 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: Damien Cassou <damien <at> cassou.me>, 79659 <at> debbugs.gnu.org
Subject: Re: bug#79659: 30.2.50; seq-min could use value< and how about
 seq-argmin?
Date: Wed, 22 Oct 2025 21:07:29 +0200
22 okt. 2025 kl. 18.36 skrev Augusto Stoffel <arstoffel <at> gmail.com>:

> I do have a random comment about value<, by the way.  I think for
> records lexicographical order is not very meaningful, and instead value<
> should be a generic function

Well it did cross my mind. Because there wasn't a standard generic function for ordering and even if there were we'd need a fallback for when the user hadn't written a specific method anyway and lexicographic order would be the obvious choice, we might as well start with that.






This bug report was last modified 13 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.