[squeak-dev] The Trunk: Kernel-ul.604.mcz
Eliot Miranda
eliot.miranda at gmail.com
Tue Jul 12 18:18:40 UTC 2011
On Tue, Jul 12, 2011 at 11:16 AM, Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:
> I already added isLarge, but it is only defined in Integer subclasses.
> This is used by divide and conquer ascii to binary conversion.
>
The default isLarge ^false needs to be in Number to use it here, right?
Even then it may have to be guarded with isNumber if we're talking about #=
& #~=.
>
> Nicolas
>
>
> 2011/7/12 Eliot Miranda <eliot.miranda at gmail.com>
>
>> So add isLargeInteger to Number and LargePosiitveInteger and
>> LargeNegativeInteger and use that instead. It may even be faster ;)
>>
>>
>> On Tue, Jul 12, 2011 at 8:05 AM, Chris Muller <asqueaker at gmail.com>wrote:
>>
>>> I need to test it, but this looks like it will hurt me. I have
>>> subclassed LargePositiveInteger but I need it to compare equally - but
>>> with this hard class-check it will now fail....
>>>
>>> On Sun, Jul 10, 2011 at 9:36 AM, <commits at source.squeak.org> wrote:
>>> > Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
>>> > http://source.squeak.org/trunk/Kernel-ul.604.mcz
>>> >
>>> > ==================== Summary ====================
>>> >
>>> > Name: Kernel-ul.604
>>> > Author: ul
>>> > Time: 10 July 2011, 4:36:20.467 pm
>>> > UUID: f758876f-a507-404b-aa2f-2c1038504b48
>>> > Ancestors: Kernel-bf.603
>>> >
>>> > Optimized Integer >> #= for integer-integer comparisons. Return false
>>> for integers from different classes without further checking.
>>> >
>>> > =============== Diff against Kernel-bf.603 ===============
>>> >
>>> > Item was changed:
>>> > ----- Method: Integer>>= (in category 'comparing') -----
>>> > = aNumber
>>> > +
>>> > + aNumber isInteger ifTrue: [
>>> > + aNumber class == self class ifFalse: [ ^false ].
>>> > + ^(self digitCompare: aNumber) = 0 ].
>>> > + aNumber isNumber ifFalse: [ ^false ].
>>> > + ^aNumber adaptToInteger: self andCompare: #=!
>>> > - aNumber isNumber ifFalse: [^ false].
>>> > - aNumber isInteger ifTrue:
>>> > - [aNumber negative == self negative
>>> > - ifTrue: [^ (self digitCompare: aNumber) = 0]
>>> > - ifFalse: [^ false]].
>>> > - ^ aNumber adaptToInteger: self andCompare: #=!
>>> >
>>> >
>>> >
>>>
>>>
>>
>>
>> --
>> best,
>> Eliot
>>
>>
>>
>>
>>
>
>
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110712/bcb12f93/attachment.htm
More information about the Squeak-dev
mailing list
|