Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-24 Thread Howard Lovatt via swift-evolution
Free functions generally work with autocomplete, however they have some disadvantages: 1. You can't easily find them when browsing with something like SwiftDoc or looking at headers via control-click in Xcode 2. Some of the compiler writers have commented that free functions slow the compiler

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-22 Thread Stephen Canon via swift-evolution
> On Feb 22, 2017, at 10:48 AM, David Sweeris via swift-evolution > wrote: > > Eh, maybe… At least in Xcode, autocomplete works for free functions. I was > just thinking about how people who already know about “signum" would expect > it to work. Like if a

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-22 Thread David Sweeris via swift-evolution
> On Feb 22, 2017, at 10:39 AM, Max Moiseev wrote: > > Free functions are much less discoverable. Think about the code completion, > for example. > >> On Feb 22, 2017, at 6:01 AM, David Sweeris > > wrote: >> >> >> On Feb

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-22 Thread Max Moiseev via swift-evolution
Free functions are much less discoverable. Think about the code completion, for example. > On Feb 22, 2017, at 6:01 AM, David Sweeris wrote: > > > On Feb 21, 2017, at 20:46, Xiaodi Wu via swift-evolution > >

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-22 Thread David Sweeris via swift-evolution
> On Feb 21, 2017, at 20:46, Xiaodi Wu via swift-evolution > wrote: > > Sign, perhaps, can be thought of as "part of a number," but signum refers to > the signum function (http://en.wikipedia.org/wiki/Sign_function) defined as: > > -1 if x < 0 > 0 if x = 0 > 1 if x

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Xiaodi Wu via swift-evolution
Sign, perhaps, can be thought of as "part of a number," but signum refers to the signum function (http://en.wikipedia.org/wiki/Sign_function) defined as: -1 if x < 0 0 if x = 0 1 if x > 0 1 isn't really "part of" 42, for instance, at least not in the sense that 42 and + are "part of" 42. On Tue,

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Howard Lovatt via swift-evolution
You raised two points: 1. "... magnitude is something the number ‘has’ whereas signum is a completely new thing ..." I think sign is as much part of a number as magnitude. Its a minor point, code complete gets it anyway. 2. "... [extras] are defined as protocol extensions, therefore they

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Colin Barrett via swift-evolution
Pardon for the misfire; I switched to a new mail client recently and it didn't behave as I was expecting. I was intending to reply to Jordan's comments upthread about popCount. On Tue, Feb 21, 2017 at 7:28 PM Colin Barrett wrote: > I'm not sure exactly where the bar

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Colin Barrett via swift-evolution
I'm not sure exactly where the bar is, but chiming in that recently, in implementing generic succinct data structures as an exercise, I needed to define exactly this operation generically. -Colin On Tue, Feb 21, 2017 at 6:29 PM Max Moiseev via swift-evolution < swift-evolution@swift.org> wrote:

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Max Moiseev via swift-evolution
> On Feb 21, 2017, at 3:05 PM, Howard Lovatt via swift-evolution > wrote: > > The re-review of SE-0104 "Protocol-oriented integers" begins now and runs > through February 25, 2017. This proposal was accepted for Swift 3, but was > not implemented in time for the

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Patrick Pijnappel via swift-evolution
Arbitrary sized signed -1 can have different popcount depending on the > underlying buffer length (if there is a buffer) even if it’s the same type > and the same value. Same with leading zeros, as the underlying > representation is unbounded on the more significant side. Sensible, why didn't I

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread John McCall via swift-evolution
> On Feb 21, 2017, at 5:39 PM, Dave Abrahams wrote: > Sent from my moss-covered three-handled family gradunza > > On Feb 21, 2017, at 10:08 AM, John McCall > wrote: > >> >>> On Feb 21, 2017, at 2:15 PM, Dave Abrahams via

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Howard Lovatt via swift-evolution
The re-review of SE-0104 "Protocol-oriented integers" begins now and runs through February 25, 2017. This proposal was accepted for Swift 3, but was not implemented in time for the release. The revised proposal is available here: > > >

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Dave Abrahams via swift-evolution
Sent from my moss-covered three-handled family gradunza > On Feb 21, 2017, at 10:08 AM, John McCall wrote: > > >> On Feb 21, 2017, at 2:15 PM, Dave Abrahams via swift-evolution >> wrote: >> >> >> >> Sent from my moss-covered three-handled

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread John McCall via swift-evolution
> On Feb 21, 2017, at 3:27 PM, Xiaodi Wu wrote: > Hmm, with respect to both endianness and Jordan's comments re popcount (and > by extension, trailing zeros and leading zeros), I think these go to the dual > purpose of `BinaryInteger` (and its refinement,

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Xiaodi Wu via swift-evolution
Hmm, with respect to both endianness and Jordan's comments re popcount (and by extension, trailing zeros and leading zeros), I think these go to the dual purpose of `BinaryInteger` (and its refinement, `FixedWidthInteger`). Both concede by their very name that they are modeling not merely a

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread John McCall via swift-evolution
> On Feb 21, 2017, at 3:08 PM, John McCall via swift-evolution > wrote: >> On Feb 21, 2017, at 2:15 PM, Dave Abrahams via swift-evolution >> > wrote: >> Sent from my moss-covered three-handled family

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread John McCall via swift-evolution
> On Feb 21, 2017, at 2:15 PM, Dave Abrahams via swift-evolution > wrote: > > > > Sent from my moss-covered three-handled family gradunza > > On Feb 21, 2017, at 9:04 AM, Jordan Rose > wrote: > >> [Proposal:

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Dave Abrahams via swift-evolution
Sent from my moss-covered three-handled family gradunza > On Feb 21, 2017, at 9:04 AM, Jordan Rose wrote: > > [Proposal: > https://github.com/apple/swift-evolution/blob/master/proposals/0104-improved-integers.md] > > Hi, Max (and Dave). I did have some questions about

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-21 Thread Jordan Rose via swift-evolution
[Proposal: https://github.com/apple/swift-evolution/blob/master/proposals/0104-improved-integers.md ] Hi, Max (and Dave). I did have some questions about this revision: > Arithmetic and SignedArithmetic

Re: [swift-evolution] [swift-evolution-announce] [Re-Review] SE-0104: Protocol-oriented integers

2017-02-17 Thread David Sweeris via swift-evolution
Sent from my iPhone > On Feb 17, 2017, at 17:45, Joe Groff wrote: > >• What is your evaluation of the proposal? Overall, a big +1 I'll 2nd not deprecating the BitwiseOperations protocol, though. >• Is the problem being addressed significant enough to warrant a