[swift-evolution] [swift-evolution-announce] Revision review: SE-104: Protocol-oriented integers

Xiaodi Wu xiaodi.wu at gmail.com
Fri Jul 21 06:50:00 CDT 2017


I understand you feel this way, but this thread is a formal review of
specific amendments to SE-0104. Those amendments are, again, the following:

* Reorganizing shift operators
* Removing the ArithmeticOverflow type in favor of using a simple Bool
* Changing BinaryInteger's initializers that convert from floating point
values
* Renaming BinaryInteger's init(extendingOrTruncating:)

On Fri, Jul 21, 2017 at 02:08 Haravikk via swift-evolution <
swift-evolution at swift.org> wrote:

>
> On 21 Jul 2017, at 02:01, Xiaodi Wu via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> Hi Howard,
>
> The removal of BitwiseOperations is not under review here; that, like
> signum(), has been considered twice and approved twice, and has not been
> revised.
>
> On Thu, Jul 20, 2017 at 19:36 Howard Lovatt via swift-evolution <
> swift-evolution at swift.org> wrote:
>
>> The revised version of the proposal can be found here:
>>>
>>> https://github.com/apple/swift-evolution/blob/master/proposals/0104-improved-integers.md
>>>
>>> • What is your evaluation of the proposal?
>>>
>>
>> Overall +1. Two reservations:
>>
>>   1. Functions like `signum()` that return a property would read better
>> as a property!
>>   2. I have found `BitwiseOperations` useful as an extension to both Bool
>> and Set and for a custom set type. Therefore would prefer its retention and
>> even more preferably that Bool and Set implement it.
>>
>> • Is the problem being addressed significant enough to warrant a change
>>> to Swift?
>>>
>>
>> Yes, generic representation of integers is useful.
>>
>>
>>> • Does this proposal fit well with the feel and direction of Swift?
>>>
>>
>> Yes, particularly the re-arrangment of the protocol hierarchy is in
>> keeping with the rest of the restructuring of the standard library.
>>
>>
>>> • If you have used other languages or libraries with a similar feature,
>>> how do you feel that this proposal compares to those?
>>>
>>
>> Yes, many languages I use allow generic numeric functions to be written
>> and I write my own numeric functions and will therefore use these protocols.
>>
>>
>>> • How much effort did you put into your review? A glance, a quick
>>> reading, or an in-depth study?
>>>
>>
>> Quick read, but have pulled my hair out trying to write generic stuff in
>> Swift as it stands now.
>>
>
> I agree with Howard on both points; In particular I've never agreed with
> the removal of BitwiseOperations, and believe it to be a mistake. What's
> the point of making Integers more protocol-oriented if you then go about
> getting rid of useful protocols?
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170721/fed934f4/attachment.html>


More information about the swift-evolution mailing list