<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 2, 2017, at 2:06 PM, Taylor Swift via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">the subscript doesn’t know about the stride that you want to use. If you want to get rid of the `<span style="font-family: monospace, monospace;" class="">at:</span>` ambiguity, you have to get rid of it everywhere, or users will just wind up having to remember two ways (one ambiguous and one less ambiguous) of doing the same thing, instead of one (ambiguous) way of doing it.<br class=""></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Certainly, that's a good point. On rethink and another re-reading of the proposal, it's unclear to me that the addition of `at` arguments to UnsafeMutablePointer is sufficiently justified by the proposal text. Is it merely that it's shorter than writing `foo + MemoryLayout<T>.stride * offset`? With the ambiguity of `at`, it seems that the current way of writing it, though longer, is certainly less ambiguous.<span class="Apple-converted-space"> </span><br class=""></div></div></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Please reread it;<span class="Apple-converted-space"> </span><span style="font-family: monospace, monospace;" class="">UnsafeMutablePointer</span>’s methods do<span class="Apple-converted-space"> </span><i class="">not</i><span class="Apple-converted-space"> </span>use `<span style="font-family: monospace, monospace;" class="">at:</span>`.</div></div></blockquote></div><br class=""><div class="">Regarding the typed buffer pointers, I think it is clear by convention, and will be well documented, that the `at` label refers to a position in `self`.</div><div class=""><br class=""></div><div class="">The raw buffer pointer API isn’t so obvious. Since the `at` refers to `self` it might more logically be a byte offset. Note that `at` as a label name always refers to a strided index.</div><div class=""><br class=""></div><div class="">This would be a bit more explicit:</div><div class="">UnsafeRawBufferPointer.initializeMemory(as:T.self, atByteOffset: position * MemoryLayout<T>.stride, from: bufferOfT)</div><div class=""><br class=""></div><div class="">But possibly less convenient… Since that `at` label currently on UnsafeRawPointer.initializeMemory is almost never used, I don’t think we need to worry too much about convenience.</div><div class=""><br class=""></div><div class="">That existing `at` label on UnsafeRawPointer.initializeMemory, would also need to be renamed, which is fine.</div><div class=""><br class=""></div><div class="">-Andy</div></body></html>