If then else

  if_instruction =
    `if' expression `then'
       instructions <lazy>
    `else'
       instructions <lazy> <if_then_else 3>
    `end' `if' 

If-then-else constructs are handled much as they are in SmallTalk: The nested instructions are packaged into block objects which `lazily' carry out the instructions when their value methods are invoked.

In other words, one adds a Boolean class to the semantic definition and define an if-then-else method for Boolean objects, passing lazy objects corresponding to the nested instruction sequences.

The else construct can be made optional by introducing an if_then method:

  if_instruction =
    `if' expression `then'
       instructions <lazy>
    (`else'
       instructions <lazy> <if_then_else 3> | <if_then 2>)
    `end' `if' 

If-then-elsif-else constructs are easily transformed into nested if-then-else constructs:

  if_instruction =
    `if' expression `then'
       instructions <lazy>
     (elsif | else | <if_then 2>)
     `end' `if'
  elsif =
    `elsif' expression `then'
       instruction <lazy>
    (elsif | else | <if_then 2>) <lazy> <if_then_else 3>
  else =
    `else'
        instructions <lazy> <if_then_else 3>