Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-20 Thread Guoye Zhang via swift-evolution
> 在 2016年10月20日,05:45,Jeremy Pereira <jeremy.j.pere...@googlemail.com> 写道: > >> >> On 19 Oct 2016, at 16:13, Guoye Zhang <cc941...@me.com> wrote: >> >> >>> 在 2016年10月19日,07:10,Jeremy Pereira <jeremy.j.pere...@googlemail.com> 写道: >&

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-19 Thread Guoye Zhang via swift-evolution
> 在 2016年10月19日,12:21,Joe Groff <jgr...@apple.com> 写道: > >> >> On Oct 19, 2016, at 9:16 AM, Guoye Zhang via swift-evolution >> <swift-evolution@swift.org> wrote: >> >>> >>> 在 2016年10月19日,11:43,Kevin Nattinger <sw...@nattinger.ne

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-19 Thread Guoye Zhang via swift-evolution
> 在 2016年10月19日,11:43,Kevin Nattinger <sw...@nattinger.net> 写道: > >> >> On Oct 19, 2016, at 8:13 AM, Guoye Zhang via swift-evolution >> <swift-evolution@swift.org> wrote: >> >> >>> 在 2016年10月19日,07:10,Jeremy Pereira <jeremy.j.pere

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-19 Thread Guoye Zhang via swift-evolution
> 在 2016年10月19日,07:10,Jeremy Pereira <jeremy.j.pere...@googlemail.com> 写道: > > >> On 18 Oct 2016, at 19:17, Guoye Zhang via swift-evolution >> <swift-evolution@swift.org> wrote: >> >> Currently, Swift Int family and UInt family have compact r

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-18 Thread Guoye Zhang via swift-evolution
> 在 2016年10月18日,15:30,David Waite <da...@alkaline-solutions.com> 写道: > > >> On Oct 18, 2016, at 12:17 PM, Guoye Zhang via swift-evolution >> <swift-evolution@swift.org> wrote: >> I propose to ban the top value in Int/UInt which is 0x... in hex. Int

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-18 Thread Guoye Zhang via swift-evolution
> 在 2016年10月18日,15:15,Joe Groff <jgr...@apple.com> 写道: > >> >> On Oct 18, 2016, at 11:17 AM, Guoye Zhang via swift-evolution >> <swift-evolution@swift.org> wrote: >> >> Currently, Swift Int family and UInt family have compact representati

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-18 Thread Guoye Zhang via swift-evolution
mory is so critical to your specific use case, use a >> non-optional and your own sentinel value. It’s likely no less efficient than >> having the compiler do it that way. >> >> (more below) >> >>> On Oct 18, 2016, at 11:17 AM, Guoye Zhang via swift-evoluti

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-18 Thread Guoye Zhang via swift-evolution
ill be implemented > efficiently? > > Nevin > > On Tuesday, October 18, 2016, Guoye Zhang via swift-evolution > <swift-evolution@swift.org> wrote: > Currently, Swift Int family and UInt family have compact representations that > utilize all available values, which

Re: [swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-18 Thread Guoye Zhang via swift-evolution
UInt intact for bitwise operations? > - If performance or memory is so critical to your specific use case, use a > non-optional and your own sentinel value. It’s likely no less efficient than > having the compiler do it that way. > > (more below) > >> On Oct 18

[swift-evolution] [Pitch] Ban the top value in Int/UInt

2016-10-18 Thread Guoye Zhang via swift-evolution
Currently, Swift Int family and UInt family have compact representations that utilize all available values, which is inherited from C. However, it is horribly inefficient to implement optional integers. It takes double the space to store [Int?] than to store [Int] because of alignment. I