<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPad</div><div><br>On Feb 2, 2017, at 7:11 AM, Matthew Johnson <<a href="mailto:matthew@anandabits.com">matthew@anandabits.com</a>> wrote:<br><br></div><blockquote type="cite"><div><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Furthermore, we emphatically do *not* need to make the distinction you claim between “infinite” and “incomplete” ranges, which *is* needless hairsplitting.</div></div></div></blockquote><div class=""><br class=""></div><div class="">Strongly disagree, unless you can describe the semantics of the type WITHOUT giving it different semantics depending on how it is used.</div></div></div></blockquote><div><br class=""></div><div>This is the point that convinced me. I’m going to take a closer look at Brent’s `RangeExpression` design which I must admit I only skimmed in the earlier discussion.</div><blockquote type="cite" class=""><div class=""><div dir="auto" class=""></div></div></blockquote></div></blockquote><div><br></div><b>We already have exactly this situation</b> with CountableRange (which will merge with Range when conditional conformances land). When used as a Collection, it means "every index value starting with the lowerBound and ending just before the upperBound". When used for slicing, it means, roughly, "take every one of the collection's indices that are in bounds." These are <u>not</u> the same thing. A collection's indices<b> need not include every expressible value of the Index type between startIndex and endIndex</b>.<div><br></div><div>The whole point of the name <b>RangeExpression</b> is to acknowledge this truth: ranges in Swift bits of syntax whose meaning is given partly by how they are used. In fact, now that I say it, in that respect ranges are not all that different any other type: the meaning of a Double or an Array<String> or a Bool is also interpreted by the methods to which it is passed, and can have completely different results depending on that context.</div><div><br></div><div>chillaxing-ly y'rs,</div><div><br></div><div>Dave</div></body></html>