<div dir="ltr"><div class="inbox-inbox-uyb8Gf" style="color:rgb(33,33,33);font-size:13px"><div><div class="inbox-inbox-F3hlO"><div dir="ltr">Distances, yes... <b>Count</b>, not necessarily. </div></div></div></div><div class="inbox-inbox-uyb8Gf" style="color:rgb(33,33,33);font-size:13px"><br class="inbox-inbox-Apple-interchange-newline"></div><br><div class="gmail_quote"><div dir="ltr">Em qua, 29 de nov de 2017 às 15:17, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com">xiaodi.wu@gmail.com</a>&gt; escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Distance must be signed, so it cannot be UInt.<br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 29, 2017 at 11:14 Wallacy &lt;<a href="mailto:wallacyf@gmail.com" target="_blank">wallacyf@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I think is that&#39;s why some folks ask for count be UInt (or UInt64 when appropriate) some time ago.</div><div><br></div><div>I dont know how solve this, but appear to be less painful than current IndexDistance.</div></div><br><div class="gmail_quote"><div dir="ltr">Em qua, 29 de nov de 2017 às 14:46, Ben Cohen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">You can argue the current status is a bug, but…<div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgba(0,0,0,0.952941)"><span style="font-variant-ligatures:no-common-ligatures">Welcome to Apple Swift version 4.0.1 (swiftlang-900.0.67 clang-900.0.38). Type :help for assistance.</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgba(0,0,0,0.952941)"><span style="font-variant-ligatures:no-common-ligatures;color:rgba(116,116,116,0.97)">  1&gt; </span><span style="font-variant-ligatures:no-common-ligatures">CountableRange&lt;Int64&gt;.IndexDistance.self</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(52,187,200);background-color:rgba(0,0,0,0.952941)"><span style="font-variant-ligatures:no-common-ligatures">$R0: Int.Type = Int</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgba(0,0,0,0.952941)"><span style="font-variant-ligatures:no-common-ligatures;color:rgba(116,116,116,0.97)">  2&gt; </span><span style="font-variant-ligatures:no-common-ligatures">(Int64.min..&lt;Int64.max).count</span></div><div style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Monaco;color:rgb(244,244,244);background-color:rgba(0,0,0,0.952941)"><span style="font-variant-ligatures:no-common-ligatures;color:#c33720">Execution interrupted. </span><span style="font-variant-ligatures:no-common-ligatures">Enter code to recover and continue.</span></div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><br><blockquote type="cite"><div>On Nov 29, 2017, at 4:04 AM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_-3321900160523398690m_7810335103129656726m_7634288037753794295Apple-interchange-newline"><div><div dir="auto">So that we are all clear on the implications of this, if IndexDistance becomes Int, ranges of integers will stop conforming to Collection, because Int.min..&lt;Int.max has Int.max * 2 elements, and Int64.min..&lt;Int64.max has potentially many more.</div><div dir="auto"><br></div><div dir="auto">This would entail nontrivial source breakage.</div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div>On Mon, Nov 27, 2017 at 22:02 Ben Cohen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">My suggestion would be: don’t have your Collection-like type conform to Collection. Give it collection-like methods if you want them, like an indexing and slicing subscript that takes an Int64. It can still conform to Sequence.<div><br></div><div>In practice, these “huge” collections will be mostly used concretely, so their Collection conformance doesn’t buy you much. The reality is that very few generic uses on these types will succeed. You get a few things like .first, .last etc. for free. But very few algorithms are written to handle &gt; Int.max lengths (several in the std lib don’t) – it just isn’t practical. And meanwhile, this is a huge burden on many other use cases.</div><div><br></div><div>The existence of the memory mapped file case is hypothetical. I canvassed a bit on twitter for some use cases. The only one I got back was where someone was using IndexDistance to stash other information: but this isn’t really a legal use of IndexDistance, since it must be numerically castable to other integer types when needed which would be a lossy operation so at best, it would just be an optimization.</div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><br><blockquote type="cite"><div>On Nov 27, 2017, at 19:29, Nevin Brackett-Rozinsky via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-3321900160523398690m_7810335103129656726m_7634288037753794295m_-8655857168457909723Apple-interchange-newline"><div><div>The proposal mentions one reasonable situation where a larger-than-Int type would be useful, namely a Collection wrapping a memory-mapped file, being used on 32-bit systems.<div><br></div><div>Is there a recommended migration strategy for this scenario?</div><div><br></div><div>Nevin</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 27, 2017 at 8:34 PM, Douglas Gregor via swift-evolution <span>&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Hello Swift community,</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">The review of SE-0191 &quot;Eliminate IndexDistance from Collection&quot; begins now and runs through December 3, 2017. The proposal is available here:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><font color="#6a737d" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0191-eliminate-indexdistance.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0191-eliminate-indexdistance.md</a></font></div></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="nofollow" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);background-color:rgb(255,255,255)"><p style="color:rgb(106,115,125);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;box-sizing:border-box;margin-top:0px;margin-bottom:16px">Proposal link:</p><blockquote style="box-sizing:border-box;margin:0px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><font color="#6a737d" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0191-eliminate-indexdistance.md" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0191-eliminate-indexdistance.md</a></font></div></blockquote></blockquote><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">Reply text</div></blockquote><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><blockquote style="box-sizing:border-box;margin:0px;padding:0px 1em;border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">Other replies</div></blockquote></blockquote><h5 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:0.875em;line-height:1.25;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;background-color:rgb(255,255,255)"><a href="https://github.com/apple/swift-evolution#what-goes-into-a-review-1" class="m_-3321900160523398690m_7810335103129656726m_7634288037753794295m_-8655857168457909723m_3304906467936138514anchor" id="m_-3321900160523398690m_7810335103129656726m_7634288037753794295m_-8655857168457909723m_3304906467936138514user-content-what-goes-into-a-review-1" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"><u></u><u></u><u></u><u></u></a>What goes into a review?</h5><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><li style="box-sizing:border-box">What is your evaluation of the proposal?</li><li style="box-sizing:border-box;margin-top:0.25em">Is the problem being addressed significant enough to warrant a change to Swift?</li><li style="box-sizing:border-box;margin-top:0.25em">Does this proposal fit well with the feel and direction of Swift?</li><li style="box-sizing:border-box;margin-top:0.25em">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</li><li style="box-sizing:border-box;margin-top:0.25em">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">More information about the Swift evolution process is available at</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(106,115,125);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(223,226,229);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)"><div style="box-sizing:border-box;margin-top:0px;margin-bottom:0px"><a href="https://github.com/apple/swift-evolution/blob/master/process.md" style="box-sizing:border-box;background-color:transparent;color:rgb(3,102,214);text-decoration:none" target="_blank">https://github.com/apple/swift-evolution/blob/master/process.md</a></div></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Thank you,</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">-Doug</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:16px;background-color:rgb(255,255,255)">Review Manager</p></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div></div>
_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div></div>
</div></blockquote></div><br></div></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>