emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/sort-key a12e41ab540 7/7: sort: add NEWS entry


From: Mattias Engdegård
Subject: scratch/sort-key a12e41ab540 7/7: sort: add NEWS entry
Date: Wed, 20 Mar 2024 14:55:01 -0400 (EDT)

branch: scratch/sort-key
commit a12e41ab54017cd572881412f92fc3971b3a7cdb
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    sort: add NEWS entry
---
 etc/NEWS | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index ccae29f6799..a7dda43f169 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1710,6 +1710,24 @@ bool-vectors, markers, buffers and processes.
 It is intended as a convenient ordering predicate for sorting, and is
 likely to be faster than hand-written Lisp functions.
 
+** 'sort' function arguments and features.
+The 'sort' function can now be called using the signature
+
+    (sort SEQ &rest KEYWORD-ARGUMENTS)
+
+where the arguments after the first are keyword/value pairs, all optional:
+':key' specifies a function that produces the sorting key from an element,
+':lessp' specifies the ordering predicate, defaulting to 'value-less-p',
+':reverse' is used to reverse the sorting order,
+':destructive' is used for in-place sorting, as the default is now to
+sort a copy of the input.
+
+The new signature is less error-prone and reduces the need to write
+ordering predicates by hand.
+
+The old signature, '(sort SEQ PREDICATE)', can still be used and sorts
+its input in-place as before.
+
 ** New function 'sort-on'.
 This function implements the Schwartzian transform, and is appropriate
 for sorting lists when the computation of the sort key of a list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]