[squeak-dev] The Inbox: Kernel-ul.1411.mcz
Tobias Pape
Das.Linux at gmx.de
Fri Sep 10 15:10:59 UTC 2021
> On 10. Sep 2021, at 16:05, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
>
> Hi Levente --
>
> > removed Integer >> #isPowerOfTwo because it was not used: all subclasses implement that method
>
> Hmm... what about removing the one in SmallInteger instead bc. its implementation is not that special. #strictlyPositive might be deprecated as well, looking at its 4 senders. Maybe just replace those few integer uses with "> 0" instead.
>
I like strictlyPositive. Not just because it's a unary message.
Please don't deprecate stuff unnecessarily :)
Best regards
-Tobias
> Best,
> Marcel
>> Am 10.09.2021 15:56:05 schrieb commits at source.squeak.org <commits at source.squeak.org>:
>>
>> Levente Uzonyi uploaded a new version of Kernel to project The Inbox:
>> http://source.squeak.org/inbox/Kernel-ul.1411.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-ul.1411
>> Author: ul
>> Time: 10 September 2021, 3:16:23.23175 pm
>> UUID: 9d7f74f9-52b9-4a1c-babf-60de439244bb
>> Ancestors: Kernel-ul.1409
>>
>> - let all Numbers respond to #isPowerOfTwo.
>> - removed Integer >> #isPowerOfTwo because it was not used: all subclasses implement that method
>>
>> =============== Diff against Kernel-ul.1409 ===============
>>
>> Item was added:
>> + ----- Method: Fraction>>isPowerOfTwo (in category 'testing') -----
>> + isPowerOfTwo
>> + "Return true if the receiver is an integral power of two."
>> +
>> + ^numerator = 1 and: [ denominator isPowerOfTwo ]!
>>
>> Item was removed:
>> - ----- Method: Integer>>isPowerOfTwo (in category 'testing') -----
>> - isPowerOfTwo
>> - "Return true if the receiver is an integral power of two."
>> -
>> - ^self strictlyPositive and: [ (self bitAnd: self - 1) = 0 ]!
>>
>> Item was added:
>> + ----- Method: Number>>isPowerOfTwo (in category 'testing') -----
>> + isPowerOfTwo
>> + "Return true if the receiver is an integral power of two."
>> +
>> + self subclassResponsibility!
>>
>> Item was added:
>> + ----- Method: ScaledDecimal>>isPowerOfTwo (in category 'testing') -----
>> + isPowerOfTwo
>> + "Return true if the receiver is an integral power of two."
>> +
>> + ^fraction isPowerOfTwo!
>>
>>
>
More information about the Squeak-dev
mailing list
|