## Sequencing instructions in Scheme

sewe
Sonntagsinformatiker
Beiträge: 295
Registriert: 16. Jan 2009 14:53
Kontaktdaten:

### Sequencing instructions in Scheme

This question popped up several times: How to sequence instructions in Scheme? To do so, use the begin special form:

Code: Alles auswählen

(define x 1)
(begin
(! x 2)
x)
The above doesn't do much but it evaluates to 1, the value of x after the set!. (Note that the value of x is now 2 even outside the begin block.)