[swift-evolution] Strings in Swift 4

Dave Abrahams dabrahams at apple.com
Fri Feb 3 11:46:32 CST 2017

on Thu Feb 02 2017, Xiaodi Wu <swift-evolution at swift.org> wrote:

> On Thu, Feb 2, 2017 at 9:45 AM, Dave Abrahams via swift-evolution <
> swift-evolution at swift.org> wrote:
> If indeed the desired semantics for ranges is that they should continue to
> lack precise semantics, then an agreement that we are going into this
> deliberately and clear documentation to that effect is the next best thing,
> I suppose.

Practically speaking, using the type system to separate ranges that are
collections from the ones that merely bound some values would not be
helpful to anyone, IMO.  If that's what you mean by saying ranges have
imprecise semantics, then that's what I, at least, desire.

A more powerful way to look at it, IMO, is that ranges unambiguously
represent one or two bounds on comparable values, and there are
operations that combine those bounds with other entities (for loops,
collections whose indices match the ranges) in useful ways.


More information about the swift-evolution mailing list