From 1a07eb7339d659fbbb452217ee7e97dae031a4b6 Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 4 Jan 2021 00:50:38 -0800 Subject: [PATCH] feat: allow transducer parts to be past as a list --- transducers.lisp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transducers.lisp b/transducers.lisp index cf75be4..5a32818 100644 --- a/transducers.lisp +++ b/transducers.lisp @@ -131,7 +131,10 @@ ((it) (funcall rf it)))))) (defun transduce (xf build seq) - (let ((transducer (funcall xf (stepper build)))) + (let* ((xf (etypecase xf + (list (apply 'alexandria:compose xf)) + ((or function symbol) xf))) + (transducer (funcall xf (stepper build)))) (unwrap build (funcall transducer (catch 'done