[squeak-dev] Boolean whenTrue:whenFalse:

K K Subbu kksubbu.ml at gmail.com
Tue May 14 17:07:58 UTC 2019


On 14/05/19 7:53 PM, Nicolas Cellier wrote:
> Hi,
>  From time to time, I need to perform some additional action (side 
> effect) when a boolean is true, but preserve that boolean as return value.

Do you mean something like:

Boolean>>whenTrue: aBlock
	self ifTrue: aBlock.
	^self

Yes, this would be useful in creating parsers.

Regards .. Subbu


More information about the Squeak-dev mailing list