Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upProposal to add methods to homogeneous tuples (`(T, T, ..., T)`) so that they can be used as slices (`&[T]`) #104
Conversation
nikomatsakis
added some commits
Jun 2, 2014
This comment has been minimized.
This comment has been minimized.
|
Implemented in rust-lang/rust#14604 |
nikomatsakis
referenced this pull request
Jun 2, 2014
Merged
Change substitutions from a flat vector into 3 vectors #14604
Valloric
reviewed
Jun 2, 2014
|
|
||
| # Alternatives | ||
|
|
||
| 1. Make fixed-length arrays a supertype of homogeneous tuples. More |
This comment has been minimized.
This comment has been minimized.
Valloric
Jun 2, 2014
IMO the RFC as presented is fine, but this alternative really is more elegant. I'd prefer it if at all possible.
This comment has been minimized.
This comment has been minimized.
|
For what it's worth this would be subsumed by #91 ( W.r.t. indexing tuples, I've had the idea that their components could be exposed as fields, except numbered rather than named, so: |
This comment has been minimized.
This comment has been minimized.
|
Given that this would only work on homogenous tuples I suppose that this wouldn't preclude the possibility of allowing the compiler to optimize tuple representation? |
This comment has been minimized.
This comment has been minimized.
|
@glaebhoerl, given that these methods would only be implemented on tuples that are congruent to arrays, I think we might as well just reuse the existing array indexing syntax. |
This comment has been minimized.
This comment has been minimized.
|
@bstrie The methods @nikomatsakis is proposing would only be for homogenous tuples... but the |
This comment has been minimized.
This comment has been minimized.
|
This is one of the tricks I realized I could have in the library, using VG. I think the old-style RFC has an example of it, actually. |
This comment has been minimized.
This comment has been minimized.
|
We decided in meeting to take no action here (yet). |
nikomatsakis commentedJun 2, 2014
Title says it all!