The let Construct

let allows local variables to be declared and to be initialized to specified values.

(let ( (var_1 value_1 )
...
(var_n value_n ) )
form_1
...
form_n )

The variables var_i are initialized to the values value_i (in some unspecified order) when the let is entered; their values may be changed using set!.

The variables var_i can be accessed by any code or procedure that is inside the let, that is, within the scope of the let. The scope of a variable is the area of program text within which it can be referenced.

The body of the let, form_1 ... form_n, is executed in order, just like a begin.

The value of the let is the value of form_n, which could be just a variable name.

Contents    Page-10    Prev    Next    Page+10    Index