[BUG] [FIX] (sm) truthAboutNothing-wiz

Peace Jerome peace_the_dreamer at yahoo.com
Sat May 22 16:14:56 UTC 2004


Recently (4/4/2004 dgd) the definition of isZero was
changed by including the method in Collections. That
necessitates a new definition of isNonZero since
isZero not being true no longer insures we have a
number. i.e. " 'foobar' isZero not" is now true. This
changeset also completes the broadening of the method
izZero by including it as a method of Object along
with isNonZero. 

here are some results of experiments. 


nil isZero "message not understood"
0.0 = 0  ^true 
nil = 0 false
nil isNumber ^false 
false = 0  ^false
false isZero "message not understood"
'foobar' isZero ^false
'' isZero ^false
-0.0 = 0 ^true
-0.0 isZero ^true
#() isZero ^false

The suggested additions:


isNonZero
	"Returns true iff nonZero number. 
	This is not the same thing as izZero not.
	The latter is true for non numbers and this is not."
	^ self isNumber
		and: [self isZero not]! !





		

	
	If there is an advantage of isZero signaling an error
for non-numbers its negated by it being defined for
collections. The annotation in Collection>>isZero
states:
	----
dgd 4/4/2004 12:14 • testing • 6 implementors • only
in change set
	----
which indicates its relatively recent.

attached is gziped version of changeset adding
isNonZero and isZero to methods for Object.


Yours in service, Jerome Peace (wiz)




	
		
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: truthAboutNothing-wiz.1.cs.gz
Type: application/x-gzip
Size: 515 bytes
Desc: truthAboutNothing-wiz.1.cs.gz
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040522/816e1525/truthAboutNothing-wiz.1.cs.bin


More information about the Squeak-dev mailing list