Home Segments Index Top Previous Next

147: Mainline

You can combine ifTrue: and ifFalse: into a two-argument message with two keywords:

Boolean expression  
  ifTrue: if-true block 
  ifFalse: if-false block 

If the Boolean expression evaluates to true, the first block is evaluated, and the second is ignored. Conversely, the second block is evaluated, and the first is ignored, if the Boolean expression evaluates to false.