Skip to content
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

Implement placement-in protocol for LinkedList #31696

Merged
merged 1 commit into from
Feb 17, 2016
Merged

Implement placement-in protocol for LinkedList #31696

merged 1 commit into from
Feb 17, 2016

Conversation

apasel422
Copy link
Contributor

@pnkfelix
Copy link
Member

I am not a member of the libs team, but my intuition is that the name emplace_back is longer than necessary; we don't have to follow C++'s precedent here.

Unfortunately deciding on a name for such methods does imply a bikeshedding discussion. . .

@pnkfelix
Copy link
Member

Cc @rust-lang/libs

@apasel422
Copy link
Contributor Author

@pnkfelix Agreed. Unfortunately, front and back are already taken.

@petrochenkov
Copy link
Contributor

place(index), front(), back() when front and back are not taken
place(index), front_place(), back_place() when front and back are taken

@alexcrichton
Copy link
Member

From a library API perspective this seems fine to me for now, we'll likely want to do a sweeping audit whenever we consider this for stabilization (aligning names for example), but for now having this as unstable seems fine to me!

@apasel422
Copy link
Contributor Author

@alexcrichton So should I update any of the names for now?

@alexcrichton
Copy link
Member

Oh I guess we don't have any prior art here (sorry I thought we had these implemented for vectors).

In terms of naming, we'll probably want to have a convention like iterators where it's super straightforward and you don't have to think about it much. Along those lines maybe something like:

  • All "placer" methods have some shared word in them. Perhaps place or emplace (I don't have much of an opinion either way)
  • Each collection may have a suite of placer methods, and if so they've all got some other prefix/suffix indicating how the placement is happening. Again, on whether it's a prefix/suffix I don't have much of an opinion
  • The returned struct has the exact same name as the method, but in camel case

So I guess within those guidelines, I'd recommend renaming the returned structs, and otherwise keeping the names as is or the front_place/back_place suggestions @petrochenkov mentioned.

@apasel422
Copy link
Contributor Author

Updated.

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 17, 2016

📌 Commit 895ab4f has been approved by pnkfelix

@bors
Copy link
Contributor

bors commented Feb 17, 2016

⌛ Testing commit 895ab4f with merge b54770c...

bors added a commit that referenced this pull request Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants