commit 5aad9d322a5d1c1a385a86d45e8cdcfc05e0a456 parent e6068e0ecd74b0d7fc85c61881f1e12be2994581 Author: Yuval Langer <yuvallangerontheroad@gmail.com> Date: Sun, 8 Oct 2023 20:15:14 +0300 Replace a recursion with cl-loop. Diffstat:
M | super-duper-yes-or-no.el | | | 20 | +++++++++----------- |
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/super-duper-yes-or-no.el b/super-duper-yes-or-no.el @@ -369,17 +369,15 @@ negative." (defun sd--make-arithmetic-problem-arguments (argument-list) "Return ARGUMENT-LIST in an arithmetic problem with actual integer values." - (cond - ((null argument-list) - '()) - ((atom (car argument-list)) - (cons (sd--make-arithmetic-problem-number) - (sd--make-arithmetic-problem-arguments - (cdr argument-list)))) - (t (cons (sd--make-arithmetic-problem - (car argument-list)) - (sd--make-arithmetic-problem-arguments - (cdr argument-list)))))) + (cl-loop + for argument + in argument-list + + collect + (if (atom argument) + (sd--make-arithmetic-problem-number) + (sd--make-arithmetic-problem + argument)))) (defun sd--make-arithmetic-problem (arithmetic-expression-template) "Make an arithmetic problem using an ARITHMETIC-EXPRESSION-TEMPLATE."