Sent from my iPhone
> On Jul 31, 2017, at 23:47, John McCall via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> I disagree; it seems to me that a homogeneous fixed-size sequence is its own 
> concept, and there isn't any natural link between that concept and that of a 
> tuple.  The elements of a tuple are independent with no naturally-implied 
> relationship; or put another way, tuple indices are nominal, not ordinal.

Right. This distinction is subtle, but important, even when the tuple is 
homogenous.

For the mathematically-inclined, this is much like the distinction between R^2 
(vector / fixed size array) and C (tuple / struct). They are isomorphic as 
vector spaces over R, but C has a bunch of extra structure that depends on one 
piece being real and the other being imaginary, but in R^2 the two components 
are always treated the same.

This even has calling convention implications; for efficiency, on most 
architectures, most of the time, it's best to pass a two-element vector as 
elements 0 and 1 of a vector register, but to pass a complex number as two 
scalars.

- Steve
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to