WhizzML Reference Manual

2.8 Sequencing

prog can be used to group together a list of expressions, which are evaluated unconditionally. The value of the last one returned as the value of the whole expression.

(prog <expression1> ... <expressionn>)

This form is useful in contexts where you can only write a single expression, such as conditional branches, but one to perform some side-effecting operation before returning the actual value of the expression:

(cond (> x 0) (prog (log-info "Positive value!") x)
      (< x 0) (prog (log-info "Negative value!") 0)
      (prog (log-info "Zero, returning -1") -1))