[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 4b79c80c999 1/2: New function 'sort-on'
From: |
Eli Zaretskii |
Subject: |
Re: master 4b79c80c999 1/2: New function 'sort-on' |
Date: |
Tue, 05 Mar 2024 14:39:02 +0200 |
> Date: Tue, 05 Mar 2024 11:21:50 +0100
> From: Michael Heerdegen via "Emacs development discussions."
> <emacs-devel@gnu.org>
>
> + (cl-macrolet ((transform (list transformer)
> + (macroexp-let2 macroexp-copyable-p l list
> + (macroexp-let2 nil ret l
> + `(progn
> + (while ,l
> + (setcar ,l ,(macroexp-let2 nil elt `(car ,l)
> + (funcall transformer elt)))
> + (setq ,l (cdr ,l)))
> + ,ret)))))
> + (transform
> + (sort (transform sequence (lambda (x) `(cons ,x (funcall accessor ,x))))
> + #'(lambda (x y) (funcall predicate (cdr x) (cdr y))))
> + (lambda (x) `(car ,x)))))
Any way you can think of rewriting this so that it's easier to read
and understand, i.e. with less macrology?
Thanks.
- Re: master 4b79c80c999 1/2: New function 'sort-on', Dmitry Gutov, 2024/03/01
- Re: master 4b79c80c999 1/2: New function 'sort-on', Michael Heerdegen, 2024/03/04
- Re: master 4b79c80c999 1/2: New function 'sort-on', Dmitry Gutov, 2024/03/04
- Re: master 4b79c80c999 1/2: New function 'sort-on', Michael Heerdegen, 2024/03/05
- Re: master 4b79c80c999 1/2: New function 'sort-on', Michael Heerdegen, 2024/03/05
- Re: master 4b79c80c999 1/2: New function 'sort-on',
Eli Zaretskii <=
- Re: master 4b79c80c999 1/2: New function 'sort-on', Michael Heerdegen, 2024/03/05
- Re: master 4b79c80c999 1/2: New function 'sort-on', Eli Zaretskii, 2024/03/06
- Re: master 4b79c80c999 1/2: New function 'sort-on', Dmitry Gutov, 2024/03/06
- Re: master 4b79c80c999 1/2: New function 'sort-on', John Wiegley, 2024/03/06
- Re: master 4b79c80c999 1/2: New function 'sort-on', Dmitry Gutov, 2024/03/06
- Re: master 4b79c80c999 1/2: New function 'sort-on', Dmitry Gutov, 2024/03/05