From 10c6c953ae2aa9432198e7362c96113cb551cfbc Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Mon, 27 Jan 2025 10:13:44 -0500 Subject: [PATCH] Maps are better than hand-made lists --- p7/operators.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p7/operators.el b/p7/operators.el index ef1f1c6..9294bf2 100644 --- a/p7/operators.el +++ b/p7/operators.el @@ -20,6 +20,6 @@ (defun sequence-works-p (l) (let ((result (car l)) (numbers (cdr l))) - (member result (-reduce (lambda (lx y) (-flatten (--map (list (|| it y) (+ it y) (* it y)) (-list lx)))) numbers)))) + (member result (-reduce (lambda (lx y) (-flatten (--map (-map (lambda (op) (funcall op it y)) '(+ * ||)) (-list lx)))) numbers)))) (apply '+ (-map 'car (-filter 'sequence-works-p data)))