[swift-dev] inefficient enum layout with optionals

2017-11-06 Thread Kelvin Ma via swift-dev
i noticed that this enum takes up 9 bytes of storage 1> enum QuantizationTable 2. { 3. case q8 (UnsafeMutablePointer), 4. q16(UnsafeMutablePointer) 5. } 6> MemoryLayout.size $R0: Int = 9 but when i make it optional, it takes up 10 7> MemoryLayout.size $R1: Int = 10 ca

Re: [swift-dev] [swift-evolution] Forums for swift.org workgroup: looking for volunteers

2017-11-15 Thread Kelvin Ma via swift-dev
im willing to help! On Wed, Nov 15, 2017 at 6:01 PM, Wallacy via swift-evolution < swift-evolut...@swift.org> wrote: > I will be on vacation after December 1, so I will have some time to help > if needed. > Em qua, 15 de nov de 2017 às 21:39, Nicole Jacque via swift-dev < > swift-dev@swift.org> e

Re: [swift-dev] Make offset index available for String

2017-12-14 Thread Kelvin Ma via swift-dev
I think there’s a middle ground here as the current API is overly complex and general. 95% of the time people are dealing with ASCII strings and don’t care about things like unicode cluster boundaries and whatnot On Thu, Dec 14, 2017 at 12:13 PM, Jordan Rose via swift-dev < swift-dev@swift.org> wr

Re: [swift-dev] Make offset index available for String

2017-12-14 Thread Kelvin Ma via swift-dev
ad just forget the Unicode rules. > > > Em qui, 14 de dez de 2017 às 17:28, Kelvin Ma via swift-dev < > swift-dev@swift.org> escreveu: > >> I think there’s a middle ground here as the current API is overly complex >> and general. 95% of the time people are dealing wit

[swift-dev] prefix map ambiguous

2018-01-11 Thread Kelvin Ma via swift-dev
when I write sequence.prefix(n).map(f) the compiler complains that .prefix is ambiguous. If I replace it with [..https://bugs.swift.org/browse/SR-1856> which looks like a similar issue but it’s marked fixed. ___ swift-dev mailing list swift-dev@swift.org

Re: [swift-dev] prefix map ambiguous

2018-01-11 Thread Kelvin Ma via swift-dev
and which > compiler version you’re seeing this on? > > I can’t reproduce this with a recent Xcode or a recent master toolchain > with this code: > > let sequence = 0..<10 > let n = 5 > let f = { $0*2 } > > sequence.prefix(n).map(f) > > Thanks > Ben >