[squeak-dev] The Trunk: Kernel-fbs.752.mcz

Frank Shearar frank.shearar at gmail.com
Sat Mar 30 22:53:08 UTC 2013


No, just following ScaledDecimal's example. (0 / 1 is the simplest
zero fraction.)

But I'm not strongly in favour of what I wrote: if 0 (the integer) is
a more sensible zero for Fraction, I'd be perfectly happy with
removing it and so falling back to Number >> #zero. I'm much more
interested in the protocol.

frank

On 30 March 2013 22:35, Nicolas Cellier
<nicolas.cellier.aka.nice at gmail.com> wrote:
> I wonder about the Fraction implementation.
> Since any Integer isFraction I think it's better to simply let super ^0.
> Synthetizing an unreduced Fraction should be restricted to very specific
> case. Do you have such specific usage?
>
> Nicolas
>
>
> 2013/3/30 <commits at source.squeak.org>
>
>> Frank Shearar uploaded a new version of Kernel to project The Trunk:
>> http://source.squeak.org/trunk/Kernel-fbs.752.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-fbs.752
>> Author: fbs
>> Time: 30 March 2013, 10:09:47.906 pm
>> UUID: 0724a0a2-6b96-4e07-94ed-79bdc4e2466b
>> Ancestors: Kernel-eem.751
>>
>> Increase the "polymorphitude" of numbers by supplying a default
>> implementation of #zero, together with a few per-type specialisations to go
>> with those we already have.
>>
>> =============== Diff against Kernel-eem.751 ===============
>>
>> Item was added:
>> + ----- Method: Float class>>zero (in category 'constants') -----
>> + zero
>> +       ^ 0.0.!
>>
>> Item was added:
>> + ----- Method: Fraction class>>zero (in category 'constants') -----
>> + zero
>> +       ^ self numerator: 0 denominator: 1.!
>>
>> Item was added:
>> + ----- Method: Number class>>zero (in category 'constants') -----
>> + zero
>> +       ^ 0.!
>>
>>
>
>
>
>


More information about the Squeak-dev mailing list