File: begin

package info (click to toggle)
scheme9 2025.08.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,080 kB
  • sloc: lisp: 16,752; ansic: 11,869; sh: 806; makefile: 237; sed: 6
file content (17 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
R4RS 4.2.3  (begin <expression1> <expression2> ...)  ==>  object

The <expression>s are evaluated sequentially from left to right,
and the value of the last expression is returned. This expression
type is used to sequence side effects such as input and output.

(define x 0)

(begin (set! x 5)
       (+ x 1))                      ==>  6

(begin (display "4 plus 1 equals ")
       (display (+ 4 1)))            ==>  unspecific
       ; side effect: print 4 plus 1 equals 5

S9fES allows BEGIN to take zero arguments, returning an unspecific
value.