emacs-devel
[Top][All Lists]
Advanced

[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.



reply via email to

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