[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 propos

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

2016-10-18 Thread Guoye Zhang via swift-evolution
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, 2016, at 11:17 AM, Guoye Zhang via swift-evolution >> wrote

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

2016-10-18 Thread Guoye Zhang via swift-evolution
; > Nevin > > On Tuesday, October 18, 2016, Guoye Zhang via swift-evolution > wrote: > 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

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

2016-10-18 Thread Guoye Zhang via swift-evolution
al 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-evolution >>> wrote: >>> >>> Currently, Swift I

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 写道: > >> >> On Oct 18, 2016, at 11:17 AM, Guoye Zhang via swift-evolution >> wrote: >> >> Currently, Swift Int family and UInt family have compact representations >> that utilize all available values, which is inh

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 写道: > > >> On Oct 18, 2016, at 12:17 PM, Guoye Zhang via swift-evolution >> wrote: >> I propose to ban the top value in Int/UInt which is 0x... in hex. Int >> family would lose its smallest value, and UInt family woul

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 写道: > > >> On 18 Oct 2016, at 19:17, Guoye Zhang via swift-evolution >> wrote: >> >> Currently, Swift Int family and UInt family have compact representations >> that utilize all available values, which is inheri

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 写道: > >> >> On Oct 19, 2016, at 8:13 AM, Guoye Zhang via swift-evolution >> wrote: >> >> >>> 在 2016年10月19日,07:10,Jeremy Pereira 写道: >>> >>> >>>> On 18 Oct 2016, at 19:17, Gu

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 写道: > >> >> On Oct 19, 2016, at 9:16 AM, Guoye Zhang via swift-evolution >> wrote: >> >>> >>> 在 2016年10月19日,11:43,Kevin Nattinger 写道: >>> >>>> >>>> On Oct 19, 2016, at 8:13

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 写道: > >> >> On 19 Oct 2016, at 16:13, Guoye Zhang wrote: >> >> >>> 在 2016年10月19日,07:10,Jeremy Pereira 写道: >>> >>> >>>> On 18 Oct 2016, at 19:17, Guoye Zhang via swift-evolution >