Bugfix: support map^3.

* module/mes/base-0.scm (map): Support third list, add more visible
  error when used with 4 or more list.
This commit is contained in:
Jan Nieuwenhuizen 2016-12-19 19:32:17 +01:00
parent 15eabee623
commit c93096fe5f

View file

@ -85,7 +85,10 @@
(if (null? l) '()
(if (null? r) (cons (f (car l)) (map f (cdr l)))
(if (null? (cdr r))
(cons (f (car l) (caar r)) (map f (cdr l) (cdar r)))))))
(cons (f (car l) (caar r)) (map f (cdr l) (cdar r)))
(if (null? (cddr r))
(cons (f (car l) (caar r) (caadr r)) (map f (cdr l) (cdar r) (cdadr r)))
'*MAP-4-NOT-SUPPORTED)))))
(define-macro (simple-let bindings . rest)
(cons (cons 'lambda (cons (map car bindings) rest))