Cause compiler error when (if ...) has spurious args

This commit is contained in:
Lassi Kortela 2019-08-28 21:19:39 +03:00
parent aca621c32e
commit 50063d4523
1 changed files with 6 additions and 3 deletions

View File

@ -262,9 +262,12 @@
(endl (make-label g)) (endl (make-label g))
(test (cadr x)) (test (cadr x))
(then (caddr x)) (then (caddr x))
(else (if (pair? (cdddr x)) (else (cond ((null? (cdddr x))
(cadddr x) (void))
(void)))) ((null? (cddddr x))
(cadddr x))
(else
(error "compile error: if expects 2-3 arguments.")))))
(cond ((eq? test #t) (cond ((eq? test #t)
(compile-in g env tail? then)) (compile-in g env tail? then))
((eq? test #f) ((eq? test #f)