If you
(require 'cl)
then you can use the Common Lisp function reduce
. Pass the keyword argument :from-end t
for foldr
.
ELISP> (reduce #'list '(1 2 3 4))
(((1 2) 3) 4)
ELISP> (reduce #'list '(1 2 3 4) :from-end t)
(1 (2 (3 4)))
If you
(require 'cl)
then you can use the Common Lisp function reduce
. Pass the keyword argument :from-end t
for foldr
.
ELISP> (reduce #'list '(1 2 3 4))
(((1 2) 3) 4)
ELISP> (reduce #'list '(1 2 3 4) :from-end t)
(1 (2 (3 4)))