Raise an error if (set! ...) is applied to a form without a value.
Exception is (%tail-call ...) form, which is permitted simply because (%tail-call ...) transfers control unidirectionally; the enclosing (%set! ...) form wouldn't be run anyway.
This commit is contained in:
parent
8e147f7989
commit
6b51229c48
|
|
@ -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))))
|
||||
|
|
|
|||
Loading…
Reference in New Issue