Previous: , Up: srfi and-let-star   [Index]


2.3.4 Specification

AND-LET* (CLAWS) BODY

CLAWS ::= '() | (cons CLAW CLAWS)
CLAW  ::=  (VARIABLE EXPRESSION) | (EXPRESSION) |
           BOUND-VARIABLE

2.3.4.1 Formal (denotational) semantics

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 ]]