mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 06:39:17 +02:00
don't error when passing dotted lists to n-ary map
This commit is contained in:
parent
e4b65f83d5
commit
e656c6e7e2
1 changed files with 3 additions and 3 deletions
|
@ -73,11 +73,11 @@
|
|||
(map1 proc (cdr ls) (cons (proc (car ls)) res))
|
||||
(reverse res)))
|
||||
(define (mapn proc lol res)
|
||||
(if (null? (car lol))
|
||||
(reverse res)
|
||||
(if (pair? (car lol))
|
||||
(mapn proc
|
||||
(map1 cdr lol '())
|
||||
(cons (apply1 proc (map1 car lol '())) res))))
|
||||
(cons (apply1 proc (map1 car lol '())) res))
|
||||
(reverse res)))
|
||||
(if (null? lol)
|
||||
(map1 proc ls '())
|
||||
(mapn proc (cons ls lol) '())))
|
||||
|
|
Loading…
Add table
Reference in a new issue