Home Segments Index Top Previous Next

298: Mainline

As you learned in Segment 145, blocks, like all other entities in Smalltalk, are objects. A receiver block is an object that responds to the whileTrue: message by evaluating itself, noting whether the answer produced by the receiver block is true, and if so, evaluating the argument block. The evaluate-receiver-block–evaluate-argument-block cycle continues as long as the receiver block evaluates to true.