summaryrefslogtreecommitdiff
path: root/srfi/srfi-1.scm
diff options
context:
space:
mode:
Diffstat (limited to 'srfi/srfi-1.scm')
-rw-r--r--srfi/srfi-1.scm23
1 files changed, 3 insertions, 20 deletions
diff --git a/srfi/srfi-1.scm b/srfi/srfi-1.scm
index 7f706a462..a937d1a4f 100644
--- a/srfi/srfi-1.scm
+++ b/srfi/srfi-1.scm
@@ -525,27 +525,10 @@
(define map1 map)
(define (append-map f clist1 . rest)
- (if (null? rest)
- (let lp ((l clist1))
- (if (null? l)
- '()
- (append (f (car l)) (lp (cdr l)))))
- (let lp ((l (cons clist1 rest)))
- (if (any1 null? l)
- '()
- (append (apply f (map1 car l)) (lp (map1 cdr l)))))))
-
-
+ (apply append (apply map f clist1 rest)))
+
(define (append-map! f clist1 . rest)
- (if (null? rest)
- (let lp ((l clist1))
- (if (null? l)
- '()
- (append! (f (car l)) (lp (cdr l)))))
- (let lp ((l (cons clist1 rest)))
- (if (any1 null? l)
- '()
- (append! (apply f (map1 car l)) (lp (map1 cdr l)))))))
+ (apply append! (apply map f clist1 rest)))
;; OPTIMIZE-ME: Re-use cons cells of list1
(define map! map)