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

Missing first, last #17

Open
conartist6 opened this issue Sep 21, 2018 · 1 comment
Open

Missing first, last #17

conartist6 opened this issue Sep 21, 2018 · 1 comment

Comments

@conartist6
Copy link
Owner

conartist6 commented Sep 21, 2018

first and last are currently defined for Lists only.

Last is going to be annoying/non-performant on Map and Set.

We will probably want to cover the common case by simply caching the most recently added item. last will be slow then only when that item has been removed. It also might just not be worth it to implement. The code to keep track of when to invalidate the saved last item would be rather nasty.

@conartist6
Copy link
Owner Author

More and more I'm thinking that for now we just exclude all the last* methods. It's the most honest with regards to what's happening under the hood, and that energy can go towards fixing the problem, which would hopefully happen as a result of the advancement of some version of a proposal for reverse iterators.

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

No branches or pull requests

1 participant