[squeak-dev] The Trunk: Kernel-ul.604.mcz

Eliot Miranda eliot.miranda at gmail.com
Tue Jul 12 17:44:12 UTC 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110712/095f4e1c/attachment.htm


More information about the Squeak-dev mailing list