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 upRFC: conventions for ownership variants #199
Conversation
This comment has been minimized.
This comment has been minimized.
|
I'm generally in favor of this sort of renaming, but I do not like I liked If
|
This comment has been minimized.
This comment has been minimized.
|
I also agree that I dislike |
steveklabnik
reviewed
Aug 14, 2014
|
|
||
| Proposal: generally standardize on `mut` as a shortening of `mut_ref`. | ||
|
|
||
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
metajack
commented
Aug 14, 2014
|
@steveklabnik I think |
This comment has been minimized.
This comment has been minimized.
|
@steveklabnik Can you elaborate on why you dislike owned? Same reasons as @kballard (i.e. By the way, in case it's not clear, |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
If So I guess I'm currently voting for |
This comment has been minimized.
This comment has been minimized.
|
I don't have strong feelings about this at all, but for what it's worth I also prefer |
This comment has been minimized.
This comment has been minimized.
Valloric
commented
Aug 15, 2014
|
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." |
This comment has been minimized.
This comment has been minimized.
|
+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 |
This comment has been minimized.
This comment has been minimized.
ben0x539
commented
Aug 17, 2014
|
If anything it should be I'm also in favor of |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
ben0x539
commented
Aug 25, 2014
|
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 |
This comment has been minimized.
This comment has been minimized.
|
@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 |
This comment has been minimized.
This comment has been minimized.
|
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. |
aturon commentedAug 14, 2014
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