Raising an error in do iterator clauses with more then 3 terms.

Provides a friendlier error for cases like issue #187.
This commit is contained in:
Alex Shinn 2013-07-20 15:12:52 +09:00
parent f5d60050a5
commit e0101944fd

View file

@ -284,7 +284,12 @@
`(,(rename 'begin)
,@(cdr (cddr expr))
(,(rename 'lp)
,@(map (lambda (x) (if (pair? (cddr x)) (car (cddr x)) (car x)))
,@(map (lambda (x)
(if (pair? (cddr x))
(if (pair? (cdr (cddr x)))
(error "too many forms in do iterator" x)
(car (cddr x)))
(car x)))
(cadr expr)))))
(check (car (cddr expr)))
(wrap