Skip to content
EN FR

Evaluation Automaton — if Expression

Documentation status: reference — see Maturity and evidence.

The current FPL grammar accepts forms with and without else.

if condition then expression
if condition then expression else expression

Evaluation protocol

prepare condition
  -> evaluate condition
  -> validate conditional result
  -> select branch
  -> evaluate selected branch only
  -> return its value

The condition is an ordinary expression and uses the same stacks, environments, and resumption rules as the rest of the engine.

Omitted else

The absence of else is an explicit grammar form. The engine must therefore represent it through FPLN value semantics rather than relying on undefined host-language behavior.

Important property

The unselected branch does not need to be evaluated. This keeps control flow compatible with deferred evaluation and expressions that may produce effects.