Shouldn't ifEmpty return self?

Benjamin Schroeder benschroeder at acm.org
Mon Jun 12 20:15:51 UTC 2006


On Jun 12, 2006, at 3:33 PM, Klaus D. Witzel wrote:

> Besides, the current Squeak implementaton of #ifEmpty: does not  
> send #value to its argument (a block) ... this method is perhaps an  
> example of one bug not canceling the other one ;-)

The block ends up having #value sent to it by #ifTrue: (when  
appropriate). #ifEmpty: just passes it along.

	"Evaluate the block if I'm empty"

	^ self isEmpty ifTrue: aBlock

Benjamin Schroeder




More information about the Squeak-dev mailing list