Block evaluation methods
Additional
Block methods are supported in CPM that allow a block to be evaluated, with or without arguments, and the result of the last statement answered. These methods follow in
Block evaluation methods.
Protocol synopsis
The principle classes and methods in CPM are summarized below.
In
Block evaluation methods,
anObject,
anotherObject, and
thirdObject refer to the first, second, and third parameters of the method.
Block evaluation methods
The following instance methods pertain to block evaluation:
argumentCount
Answers the number of arguments to the receiver.
value
Evaluates the receiver. Answers the result of the last statement to be evaluated.
value:
Evaluates the receiver with parameter anObject. Answers the result of the last statement to be evaluated.
value:value:
Evaluates the receiver with parameters anObject and anotherObject. Answers the result of the last statement to be evaluated.
value:value:value:
Evaluates the receiver with parameters anObject, anotherObject, and thirdObject. Answers the result of the last statement to be evaluated.
valueWithArguments:
Evaluates the receiver with the specified array. Answers the result of the last statement to be evaluated.
valueOnReturnDo:
Evaluates the receiver. Answers the result of the last statement to be evaluated. When the receiver returns, evaluate the specified block.
value:onReturnDo:
Evaluates the receiver with parameter anObject. Answers the result of the last statement to be evaluated. When the receiver returns, evaluate the specified block.
value:value:onReturnDo:
Evaluates the receiver with parameters anObject and anotherObject. Answers the result of the last statement to be evaluated. When the receiver returns, evaluate the specified block.
value:value:value:onReturnDo:
Evaluates the receiver with parameters anObject, anotherObject, and thirdObject. Answers the result of the last statement to be evaluated. When the receiver returns, evaluate the specified block.
valueWithArguments:onReturnDo:
Evaluates the receiver with the specified array. Answers the result of the last statement to be evaluated. When the receiver returns, evaluate the specified block.
Tip:
These additional Block methods allow a block to be evaluated, with or without arguments, and the result of the last statement answered. anObject, anotherObject, and thirdObject parameters refer to the first, second, and third parameters of the method.
Last modified date: 01/29/2015