ifTrue

infix inline fun Boolean.ifTrue(block: Block)

evaluates a block if the receiver is boolean true value, this is smalltalk's way of if statement.

Parameters

<receiver>

Boolean

block

block of code to execute if true

inline fun Boolean.ifTrue(block: Block, ifFalse: Block)

evaluates first block if the receiver is boolean true value, otherwise evaluates the second block, this is smalltalk's way of if...else statement.

Parameters

<receiver>

Boolean

block

block of code to execute if true

ifFalse

block of code to execute if false