previous up next     contents index
Next: Let Up: Conditionals Previous: Cond and Case

When, Unless, and Begin0

The  when and  unless forms conditionally evaluate a single body of expressions:

The result of a when or unless expression is the result of the last body expression if the body is evaluated, or #<void> if the body is not evaluated.

The  begin0 form is like  begin, but the value of the first expression in the form is returned instead of the last expression:

 
   (let ([x 4])
     (begin0 x (set! x 9) (display 'done))) ; => displays done then returns 4 


PLT