diff --git a/compiler.ss b/compiler.ss index 2fafc97..be7b80f 100755 --- a/compiler.ss +++ b/compiler.ss @@ -35,7 +35,9 @@ (if (or (not (pair? subform)) (memq (first subform) '(%apply %car %cdr %cons %bind %if))) (list (simplify-set! `(set! ,(second form) ,subform))) - (list subform)))) + (if (and (pair? subform) (eq? (first subform) '%tail-call)) + (list subform) ; The %set! wouldn't be executed anyway. + (error "set! used with non-value form:" subform))))) '() (cddr value-form))) `(%set! ,(second form) ,value-form))))