Previous: baselib expressions binding, Up: baselib expressions [Index]
The ?begin keyword has two different roles, depending on its context:
begin form that
appears in a body. In this case, the begin form must have the
shape specified in the first header line. This use of begin acts
as a splicing form: the forms inside the ?body are spliced
into the surrounding body, as if the begin wrapper were not
actually present.
A begin form in a ?body or ?library-body must be
non–empty if it appears after the first ?expression within the
body.
(define x 0)
(begin (set! x 5)
(+ x 1))
⇒ 6
(begin (display "4 plus 1 equals ")
(display (+ 4 1)))
⇒ unspecified
-| 4 plus 1 equals 5