<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 Sep 6, 2017, at 9:52 PM, Slava Pestov <<a href="mailto:spestov@apple.com" class="">spestov@apple.com</a>> wrote:</div><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Sep 6, 2017, at 7:57 PM, Brent Royal-Gordon via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">This is going against the grain, but I think we should order by name and therefore allow reordering, but not renaming. If an API is public, renaming is obviously going to be source-breaking and could easily be ABI-breaking; I don't think it's that hard to explain that renaming can also be ABI-breaking when you've declared your type's layout is part of your module's ABI.</div></div></div></blockquote><div class=""><br class=""></div><div class="">However, @fixedContents structs can also contain private stored properties. Renaming a private property is not source-breaking (but if we sort by name when performing layout, it will be ABI breaking).</div></div></div></div></blockquote><div><br class=""></div><div>I understand that. I think this is explicable if you think of `@fixedContents` as intentionally compromising the privacy of private stored properties. And I think that attaching this feature to the `public` keyword would help to encourage that mindset.</div><div><br class=""></div><div>Another way to encourage a "don't change this" mindset would be to use a word like "frozen" in the attribute/keyword. It wouldn't be surprising if you caused problems by changing something you've "frozen". Example:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@frozen(var) public struct Foo { … }</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@frozen(case) public enum Bar { … }</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">As for the keyword…maybe `public(layout)` or `public(storage)`? People are familiar with the idea that you have to be careful when you change something that's public, so it wouldn't be surprising that a type with a public layout would be sensitive to changes to its memory layout.</div></div></blockquote><div class=""><br class=""></div>I’m hesitant to use a keyword rather than an @attribute for this, because (for the most part) attributes don’t change the language semantics of a declaration, only its implementation (of course there are exceptions, like @objc which introduces restrictions, etc).</div></div></div></blockquote><br class=""></div><div>I feel like I must not understand what you mean by semantics vs. implementation, because most of the attributes I can think of handle things I would consider to be "semantics". `@escaping`, `@autoclosure`, `@available`, `@discardableResult`, etc.</div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; border-spacing: 0px;"><div class=""><div style="font-size: 12px; " class="">-- </div><div style="font-size: 12px; " class="">Brent Royal-Gordon</div><div style="font-size: 12px; " class="">Architechies</div></div></span>
</div>
<br class=""></body></html>