|
Re: Re: Proper fractions?: msg#00140lang.smalltalk.squeak.beginners
Blake, if you actually want to make this work in your image, you could do this: Fraction>>printOn: aStream base: base | int | (int := self integerPart) = 0 ifTrue: [aStream nextPut: $(. numerator printOn: aStream base: base. aStream nextPut: $/. denominator printOn: aStream base: base. aStream nextPut: $)] ifFalse: [aStream nextPut: $(. int printOn: aStream base: base. aStream nextPut: $+. self fractionPart printOn: aStream base: base. aStream nextPut: $)] (and delete Fraction>>printOn: which os redundant anyway) I can see how this would be helpful in debugging if you deal with fractions a lot. - Bert - On Jul 26, 2007, at 23:43 , Bert Freudenberg wrote: This would work:
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: Proper fractions?, Bert Freudenberg |
|---|---|
| Next by Date: | Re: Re: Proper fractions?, Blake |
| Previous by Thread: | Re: Re: Proper fractions?, Bert Freudenberg |
| Next by Thread: | Re: Re: Proper fractions?, Blake |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |