[swift-evolution] [Pitch] Renaming sizeof, sizeofValue, strideof, strideofValue

Patrick Smith pgwsmith at gmail.com
Fri Jun 3 21:59:04 CDT 2016


Looks good! I definitely like the ‘memory’ prefixes for the functions. I appreciate that stating the name earlier with the functions vs MemoryLayout<Type>.blah is easier to read.

It feels a little bit of a shame to make `memorySize(ofType:)` longer than `memorySize(of:)`, as I think it will be used more and is the more direct variation of the two. I can see that it matches `type(of:)`. I’d possibly advocate for `memorySize(ofType:)` and `memorySize(ofValue:)`, as it’s less ambiguous and may steer those coming from `sizeof` in the right direction.

Patrick

> On 4 Jun 2016, at 7:11 AM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Discussion has more or less drawn down. Are there any further significant requests / issues that need addressing? Both standalone functions (my recommended approach)  and the MemoryLayout<T> struct approach (alternative, with reasons why I think it's not as ideal) are discussed in-proposal.
> 
> Pull Request: https://github.com/apple/swift-evolution/pull/350
> 
> Thanks, -- Erica
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list