-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal to add methods to homogeneous tuples ((T, T, ..., T)
) so that they can be used as slices (&[T]
)
#104
Conversation
Implemented in rust-lang/rust#14604 |
|
||
# Alternatives | ||
|
||
1. Make fixed-length arrays a supertype of homogeneous tuples. More |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the RFC as presented is fine, but this alternative really is more elegant. I'd prefer it if at all possible.
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: |
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? |
@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. |
@bstrie The methods @nikomatsakis is proposing would only be for homogenous tuples... but the |
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. |
We decided in meeting to take no action here (yet). |
Allows for graceful shutdown of the oneshot by closing and then checking for a message. Closes rust-lang#104
Title says it all!