<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On 04 Jun 2016, Erica Sadun wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">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.<br class=""><br class="">Pull Request: <a href="https://github.com/apple/swift-evolution/pull/350" class="">https://github.com/apple/swift-evolution/pull/350</a><br class=""></div></div></blockquote></div><br class=""><div class=""><div class="">Good proposal, Erica!</div><div class=""><br class=""></div><div class="">Regardless of the little input I've given to this discussion, I actually prefer the set of `<font face="Menlo" class="">memory*</font>` prefixed top-level functions to a `<font face="Menlo" class="">MemoryLayout</font>` struct or tuple.</div><div class=""><br class=""></div><div class="">However, I think it's most common to call these functions with a type argument, and we should thus stick to the practice of keeping that use case short, and the call-with-value case explicit. In particular, I'd avoid the label for a type argument, and say `<font face="Menlo" class="">ofValue:</font>` when passing a value:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class=""> memorySize(ofType:) → memorySize(<b class="">_:</b>)</font></div><div class=""><font face="Menlo" class=""> memorySize(of:) → memorySize(<b class="">ofValue:</b>)</font></div><div class=""><font face="Menlo" class=""> memoryInterval(ofType:) → memoryInterval(<b class="">_:</b>)</font></div><div class=""><font face="Menlo" class=""> memoryInterval(of:) → memoryInterval(<b class="">ofValue:</b>)</font></div><div class=""><font face="Menlo" class=""> memoryAlignment(ofType:) → memoryAlignment(<b class="">_:</b>)</font></div><div class=""><font face="Menlo" class=""> memoryAlignment(of:) → memoryAlignment(<b class="">ofValue:</b>)</font></div><div class=""><br class=""></div><div class="">Secondly, (this might be over-engineering but) would it still make sense to use `<font face="Menlo" class="">@autoclosure</font>` in the `<font face="Menlo" class="">ofValue:</font>` functions because they don't really need their arguments evaluated?</div><div class=""><br class=""></div><div class=""><font face="Menlo" class=""> <b class="">public func</b> memorySize<T>(ofValue _: <b class="">@autoclosure</b> T -> ()) -> Int</font></div><div class=""><font face="Menlo" class=""> <b class="">public func</b> memoryInterval<T>(ofValue _: <b class="">@autoclosure</b> T -> ()) -> Int</font></div><div class=""><font face="Menlo" class=""> <b class="">public func</b> memoryAlignment<T>(ofValue _: <b class="">@autoclosure</b> T -> ()) -> Int</font></div><div class=""><br class=""></div><div class="">— Pyry, whose name gets autocoerced in various ways apparently.</div></div><div class=""><br class=""></div></body></html>