<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Thank you for the feedback. Answers online.<br><br>Sent from my iPhone</div><div><br>On Jul 16, 2016, at 7:38 PM, Andrew Trick &lt;<a href="mailto:atrick@apple.com">atrick@apple.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 16, 2016, at 6:46 PM, Arnold Schwaighofer via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><p class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);">Replace&nbsp;<code class="" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">isUniquelyReferenced&lt;T : NonObjectiveCBase&gt;</code>&nbsp;by&nbsp;<code class="" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">isUniquelyReferencedUnsafe&lt;T: AnyObject&gt;</code>&nbsp;and remove the&nbsp;<code class="" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">NonObjectiveCBase</code>&nbsp;class from the standard library.</p><div class=""><br class=""></div></div></blockquote><br class=""></div><div>So we’ll have:</div><div><br class=""></div><div>- isUniquelyReferencedNonObjC(object): true iff object is uniquely referenced and NonObjC</div><div><br class=""></div><div>- isUniquelyReferencedUnsafe(object): true iff object is uniquely reference, assert NonObjC</div><div><br class=""></div><div>I’m going to be picky. The “Unsafe” suffix doesn’t make sense to me. If you think this is an unsafe API then it should be:</div><div>“unsafeIsUniquelyReferenced”.</div><div><br class=""></div><div>But I don’t really see how it is unsafe in the usual sense. If you want to convey that the programmer needs to satisfy some precondition, which is not generally associated with unsafety, then it should be:</div><div>“isUniquelyReferencedAssumingNonObjC”</div><div><br class=""></div></div></blockquote><div><br></div>Makes sense to me. I think it is unsafe in the sense if you don't satisfy the precondition the resulting behavior is undefined in modes other than -Onone and not checked by a precondition predicate that traps.<div><br></div><div><blockquote type="cite"><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">unsafeIsUniquelyReferenced</span></font></blockquote><br></div><div>I find it kind of nice to recognize a predicate by the 'is' prefix. All unsafe APIs start with the word unsafe though. I could not find an unsafe freestanding predicate.<br><div><br></div><div><div><div><div>[As the implementor of the underlying builtin you may remember that it is not actually undefined and will return a implementation defined value (false) for objc classes. But we might not want to guarantee this going forward.]</div><div><br><blockquote type="cite"><div><div>Frankly, the type was a nicer way to do this, by I understand removing it from the API surface.</div><div><br class=""></div><div>-Andy</div></div></blockquote></div></div></div></div></div></body></html>