On Sat, Nov 25, 2017 at 16:44 Mike Kluev <mike.kl...@gmail.com> wrote:
> On 25 November 2017 at 22:38, Xiaodi Wu <xiaodi...@gmail.com> wrote: > >> On Sat, Nov 25, 2017 at 4:30 PM, Mike Kluev <mike.kl...@gmail.com> wrote: >> >>> >>>> i haven't encounter this notation before so it looks strange and >>> requires some effort to decipher. if it was e.g. in this form: >>> >>> extension (Equatable...) : Equatable >>> >>> then it would be immediately obvious what it means, IMHO >>> >> >> That reads to me like you are extending a tuple of type `(Equatable...)`. >> This is not the same as extending a tuple of type `(E...) where ...E : >> Equatable`. >> > > and if Equatable is not a type but a protocol then the practical > difference is what ? > Not sure what you’re asking. Equatable is a protocol. For a protocol P, (P, P) is a concrete type with two elements each of existential type P. For a type T : P, a tuple of type (T, T) is not a tuple of type (P, P). If we can extend tuples, you can write a generic algorithm that works with any type (T, T) where T : P, and/or you can write an algorithm that works with concrete type (P, P). Note that there is no overlap between these two because existential type P does not conform to protocol P.
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution