-
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
RFC: conventions for ownership variants #199
Conversation
I'm generally in favor of this sort of renaming, but I do not like I liked If
|
I also agree that I dislike |
|
||
Proposal: generally standardize on `mut` as a shortening of `mut_ref`. | ||
|
||
|
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.
✂️
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.
Maybe ruining a joke, but I don't know what this means :)
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.
Sorry, there's an extra blank line here, so you should snip it 😄
@steveklabnik I think |
@steveklabnik Can you elaborate on why you dislike owned? Same reasons as @kballard (i.e. By the way, in case it's not clear, |
I'm not fully sure, but
Seems right, or at least part of it. I'll do some reflecting here. (I think it may be because we've been dropping the term 'owned pointer' in favor of 'box', and so even though this isn't related, that's just hanging on.) I think |
If So I guess I'm currently voting for |
I don't have strong feelings about this at all, but for what it's worth I also prefer |
Agreed that Also don't forget that Rust's biggest potential market is C++ developers and to them "moving" is a familiar concept (or at least should be, if they stayed up to date with C++11). C++ has move constructors, move assignment etc. Not "owned" constructors. Furthermore, "move" as a verb tells you about the action, while "owned" (since it's an adjective) appears to be talking about the iterator itself and reads to me like "iterate over this owned iterator." |
+1 to _move, -1 to _owned. I think iterators are about doing stuff (they are a function encapsulated as an object, in a way) so I prefer a verb to an adjective. In particular, the iterator doesn't own anything, so I find |
If anything it should be I'm also in favor of |
Using the word While for specific types like For example, one could image this in a future Rust:
for which a The Better would be |
Types not being I don't agree that the "move" terminology stems from the behavior of boxes, since it was already prevalent in C++. I also don't understand your point about "not |
@ben0x539: Moves are the general case if you don't know anything about the type, like for unbounded generics, yes. But what I'm saying here is that the naming of these methods should be correct in regard to each specific use of the method, that is where the types are known: let v = [1, 2, 3];
let iter = v.iter_move(); // This is a lie - a copy happens, not a move
let v2 = v;
Names are documentation to help the understanding of the code, and thus is should not use terminology that is in contradiction to the language semantic. Not sure what point I was trying to make with |
Based on the weekly meeting: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-08-26.md
This was discussed in this week's meeting, and the decision was to merge with the alteration of As a result, I am going to merge this. |
Pass through all errors in both Stream::take and Stream::skip until stream is done.
This is a conventions RFC for settling naming conventions when there
are by value, by reference, and by mutable reference variants of an
operation.
Rendered