[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 4b79c80c999 1/2: New function 'sort-on'
From: |
Daniel Mendler |
Subject: |
Re: master 4b79c80c999 1/2: New function 'sort-on' |
Date: |
Fri, 02 Feb 2024 16:26:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Daniel Mendler <mail@daniel-mendler.de>
>> Cc: Eli Zaretskii <eliz@gnu.org>
>> Date: Fri, 02 Feb 2024 16:00:09 +0100
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > branch: master
>> > commit 4b79c80c999fe95654b7db196b12e0844473f6da
>> > Author: Eli Zaretskii <eliz@gnu.org>
>> > Commit: Eli Zaretskii <eliz@gnu.org>
>> >
>> > New function 'sort-on'
>> >
>> > * lisp/sort.el (sort-on): New function. Patch by John Wiegley
>> > <jwiegley@gmail.com>.
>> >
>> > * etc/NEWS:
>> > * doc/lispref/sequences.texi (Sequence Functions): Document
>> > 'sort-on'.
>>
>> Would this function fit into the seq library, named seq-sort-on?
>
> "Fit" in what sense?
The function works with other sequence types too and it seems a good
idea to collect sequence-related functionality in seq.el.
> This function can only sort lists, so at least from that aspect its
> place is not in seq.el. In addition, I see no reason to have it
> preloaded.
No, in the current form, the function works on vectors too. It always
returns a list though. But maybe it makes sense to generalize it such
that it returns the same type as the argument.
> I've put it in sort.el because the function 'sort' is there.
No, sort is defined in src/fns.c.
Daniel