diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-08-17 07:15:55 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-08-17 07:15:55 -0700 |
commit | 1a4bdbc566683f0e70412fd75af233526803d0d2 (patch) | |
tree | 2810e787cba69552aeca6ed73ccfcdfed291ebb6 /stdlib/csort.tl | |
parent | 927ce14064e931edcf9f55582fd6a4f4b7c0567c (diff) | |
download | txr-1a4bdbc566683f0e70412fd75af233526803d0d2.tar.gz txr-1a4bdbc566683f0e70412fd75af233526803d0d2.tar.bz2 txr-1a4bdbc566683f0e70412fd75af233526803d0d2.zip |
New function: csort-group.
* autoload.c (csort_set_entries): Register csort-group
as autoload trigger for stdlib/csort.tl.
* stdlib/csort.tl (csort-group): New function.
* tests/012/sort.tl: Tests for sort-group and csort-group.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib/csort.tl')
-rw-r--r-- | stdlib/csort.tl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/stdlib/csort.tl b/stdlib/csort.tl index 44715236..345b4ce8 100644 --- a/stdlib/csort.tl +++ b/stdlib/csort.tl @@ -41,3 +41,6 @@ (defun csnsort (seq : (less-fun :) (key-fun :)) (cached-sort-body snsort)) + +(defun csort-group (seq : (key-fun :) (less-fun :)) + (partition-by key-fun (csort seq less-fun key-fun))) |