[squeak-dev] The Inbox: Kernel-ul.1411.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Fri Sep 10 15:41:33 UTC 2021


Hi Tobias --

> Please don't deprecate stuff unnecessarily :)

Why do you think that #strictlyPositive is necessary? Well, we can at least leave it as a convenience method. I was just curious why we would not want to use it in SmallInteger. I suspected performance ...

Best,
Marcel
Am 10.09.2021 17:11:12 schrieb Tobias Pape <das.linux at gmx.de>:


> On 10. Sep 2021, at 16:05, Marcel Taeumel 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 :
>>
>> 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!
>>
>>
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210910/36464ab4/attachment.html>


More information about the Squeak-dev mailing list