[swift-evolution] [Discussion] Rename BitwiseOperations protocol
rileytestut at gmail.com
Sun Jul 3 15:53:20 CDT 2016
Wasn't there a proposal to stop defining methods in addition to global operators? I would very much support that, doesn't make sense to me to have two ways to do the same thing IMO.
> On Jul 3, 2016, at 3:40 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jul 3, 2016, at 9:41 AM, Nevin Brackett-Rozinsky via swift-evolution <swift-evolution at swift.org> wrote:
>> I am still curious why the SE-0104 FixedWidthInteger protocol uses member functions like “.xor” rather than operators for bitwise manipulation.
> The global operators are implemented in terms of those methods in the protocol.
>>> On Fri, Jul 1, 2016 at 8:19 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>>> on Fri Jul 01 2016, Riley Testut <swift-evolution at swift.org> wrote:
>>> > Hi all,
>>> > This is probably very minor, but I’m not sure the protocol name
>>> > “BitwiseOperations” fits the Swift API Design Guidelines. Here’s what
>>> > the guidelines have to say about protocol names:
>>> > Protocols that describe what something is should read as nouns (e.g. Collection).
>>> > Protocols that describe a capability should be named using the
>>> > suffixes able, ible, or ing (e.g. Equatable, ProgressReporting).
>>> > From these two, BitwiseOperations appears to be (attempting) to follow
>>> > the first rule, yet “BitwiseOperations” doesn’t really describe what
>>> > the type is, but rather that it can do bitwise operations. The
>>> > documentation itself even describes the protocol as “a type that
>>> > supports standard bitwise arithmetic operators."
>>> > I propose we rename it to “BitwiseOperable”, or something
>>> > similar. Again, a small change, but if this were to ever happen, I
>>> > think Swift 3 is the time.
>>> BitwiseOperations should really be retired after
>>> is implemented, and its uses replaced by FixedWidthInteger.
>>> swift-evolution mailing list
>>> swift-evolution at swift.org
>> swift-evolution mailing list
>> swift-evolution at swift.org
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution