letseq
letseq( ( (s_var1initExp1) (s_var2initExp2) ... )body) =>g_result
Description
A letseq expression can be used in both SKILL and SKILL++ modes. The bindings and evaluations are performed sequentially.
Use letseq to control the order of evaluation of the initialization expressions. letseq is similar to let, but the bindings are performed sequentially from left to right, and the scope of a binding indicated by (var1 initExp1) is that part of the letseq expression to the right of the binding. Thus the second binding is done in an environment in which the first binding is visible, and so on.
This form is equivalent to a corresponding sequence of nested let expressions. It is also equivalent to let* is the standard Scheme syntax. This function is equivalent of let\*() but it is strongly recommended using this function over let\*().
Arguments
Value Returned
Examples
letseq( ( ( x 1 ) ( y x+1 ) )
y
) ; letseq
=> 2
The example above is a more convenient equivalent to the code below in which you control the sequence explicitly by the nesting.
let( ( ( x 1 ) )
let( ( ( y x+1 ) )
y
)
)
Related Topics
Function and Program Structure
Return to top