Previous: srfi and-let-star rationale, Up: srfi and-let-star [Index]
AND-LET* (CLAWS) BODY CLAWS ::= '() | (cons CLAW CLAWS) CLAW ::= (VARIABLE EXPRESSION) | (EXPRESSION) | BOUND-VARIABLE
CLAWS
are evaluated in the strict left–to–right order.
CLAW
, the EXPRESSION
part is evaluated first (or
BOUND-VARIABLE
is looked up)
#f
, and-let*
immediately returns
#f
.
claw
is of the form (VARIABLE
EXPRESSION)
the EXPRESSION
’s value is bound to a freshly made
VARIABLE
.
VARIABLE
is available for the rest of the CLAWS
, and
the BODY
.
VARIABLE
s must be unique (like in let*
).
eval[ (AND-LET* (CLAW1 ...) BODY), env] = eval_claw[ CLAW1, env ] andalso eval[ (AND-LET* ( ...) BODY), ext_claw_env[CLAW1, env]] eval[ (AND-LET* (CLAW) ), env] = eval_claw[ CLAW, env ] eval[ (AND-LET* () FORM1 ...), env] = eval[ (BEGIN FORM1 ...), env ] eval[ (AND-LET* () ), env] = #t eval_claw[ BOUND-VARIABLE, env ] = eval[ BOUND-VARIABLE, env ] eval_claw[ (EXPRESSION), env ] = eval[ EXPRESSION, env ] eval_claw[ (VARIABLE EXPRESSION), env ] = eval[ EXPRESSION, env ] ext_claw_env[ BOUND-VARIABLE, env ] = env ext_claw_env[ (EXPRESSION), env ] = env-after-eval[ EXPRESSION, env ] ext_claw_env[ (VARIABLE EXPRESSION), env ] = extend-env[ env-after-eval[ EXPRESSION, env ], VARIABLE boundto eval[ EXPRESSION, env ]]