Unary - Binary message

Richard A. O'Keefe ok at atlas.otago.ac.nz
Fri Oct 26 00:11:03 UTC 2001


Torge Husfeldt <jean-jacques.gelee at gmx.de> wrote:
	Your example will balk over the sequence:
	c:= Counter new.
	c decrementIfPositive.
	
So it will.

	Better write 
	decrementIfPositive
	self value > 0 ifTrue: [value := value - 1].
	
And yes that is better.  In fact, it's what I *meant* to write.  Sigh.





More information about the Squeak-dev mailing list