On Sun, 2007-01-21 at 22:40 -0700, J Pfersich wrote:
> st> var5 printString !
> '3/4'
> st> var5 storeOn: stdout !
> (Fraction numerator: 3 denominator: 3)Fraction new "<0x1057dc0>"
> st>
> The numerator is also used as the denominator.

heh :)  See attachment.  (Paolo: fixed in
[EMAIL PROTECTED]/smalltalk--backstage--2.2--patch-4
"fix wrong varref in Fraction>>#storeOn:".)

> I also found that the class comment is inaccurate, the arithmatic operators
> do not answer a reduced fraction, the reduce private method is never accessed.

See the category 'arithmetic' method bodies.

st> ((3/4) * (2/3)) inspect!
An instance of Fraction
  numerator: 1
  denominator: 2

-- 
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
"Peta" is Greek for fifth; a petabyte is 10 to the fifth power, as
well as fifth in line after kilo, mega, giga, and tera.
  -- Lee Gomes, performing every Wednesday in his tech column
     "Portals" on page B1 of The Wall Street Journal
2007-01-22  Stephen Compall  <[EMAIL PROTECTED]>

	* kernel/Fraction.st: Print denominator for storeOn: as
	denominator, not numerator as denominator.
	Reported by J Pfersich.

--- orig/kernel/Fraction.st
+++ mod/kernel/Fraction.st
@@ -375,7 +375,7 @@
     aStream nextPutAll: '(Fraction numerator: ';
 	store: numerator;
 	nextPutAll: ' denominator: ';
-	store: numerator ;
+	store: denominator;
 	nextPut: $)
 ! !
 

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to