map: support two lists.
This commit is contained in:
parent
717ae9cdc1
commit
de2e9502cf
4
scm.mes
4
scm.mes
|
@ -95,4 +95,6 @@ EOF
|
||||||
|
|
||||||
(define (map f l . r)
|
(define (map f l . r)
|
||||||
(cond ((null l) '())
|
(cond ((null l) '())
|
||||||
((null r) (cons (f (car l)) (map f (cdr l))))))
|
((null r) (cons (f (car l)) (map f (cdr l))))
|
||||||
|
((null (cdr r))
|
||||||
|
(cons (f (car l) (caar r)) (map f (cdr l) (cdar r))))))
|
||||||
|
|
Loading…
Reference in a new issue