[swift-evolution] [Review] SE-0101: Rename sizeof and related functions to comply with API Guidelines

Erica Sadun erica at ericasadun.com
Tue Jun 21 18:07:24 CDT 2016


> On Jun 21, 2016, at 3:02 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> If I didn't think it would produce semantic confusion, these would be
> static members e.g. `Array.memoryAlignment`, and you'd have to “scan
> past” `Array`.  It's a perfectly natural way to express a property of a
> type.


I think

Array<Int>.memoryAlignment 

is quite different to scan than

MemoryLayout(Array<Int>).alignment

(And I obviously like the former a lot more if it wouldn't produce
semantic confusion -- I assume you mean in the compiler and not
the reader of the code). That said, I think

memoryAlignment(Array<Int>.self)

reads better than

MemoryLayout(Array<Int>).alignment

You don't have to brainparse(TM by Cognition Inc) two other things 
before arriving at alignment.  The MemoryLayout feels more prominent
than it should. The alignment feels less prominent than it should.

I recognize we disagree on this, and we're unlikely to convince each other 
on-list, which is why I tried hard to make sure that your alternative was 
properly presented in the proposal. If  I have made any errors in expressing 
your design, its intent, and rationale, please let me know and I will edit the 
proposal to fix.

-- E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160621/583a3a54/attachment.html>


More information about the swift-evolution mailing list