From a4bd0184803089ad9f2370f4c24e083bef8641ed Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 27 Nov 2011 21:43:58 +0900 Subject: [PATCH] map handles mismatched list lengths when the first list isn't the shortest --- lib/init-7.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/init-7.scm b/lib/init-7.scm index 8285bdd7..f95332ad 100644 --- a/lib/init-7.scm +++ b/lib/init-7.scm @@ -76,7 +76,7 @@ (map1 proc (cdr ls) (cons (proc (car ls)) res)) (reverse res))) (define (mapn proc lol res) - (if (pair? (car lol)) + (if (every pair? lol) (mapn proc (map1 cdr lol '()) (cons (apply1 proc (map1 car lol '())) res))