-
Notifications
You must be signed in to change notification settings - Fork 53
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
SlicingIterator preserves keys: should it? #16
Comments
Note that function slice($start, $count) {
return $this->skip($start)->limit($count);
} Maybe that will help make semantic sense of everything, I'm not sure. |
Whenever I have realizations like this I always want to implement it immediately. Implementing it as above could eliminate a class. It's a bit off topic for this issue, but I'll think about it. |
I've decided that algorithms should preserve keys by default. Once keys are stripped one cannot magically get them back, but generally one easily re-assign the keys if desired. This ticket will remain open until I've fixed things to retain keys by default. |
This here probably is fixed? Also I wouldn't keep it open until the rest is fixed, but just state your decision and close it if implemented. |
I am thinking that this repository will narrow its scope to remove methods like |
My expectation on a slice is that the keys would be renumbered, since slicing something that doesn't really have an order is sort-of undefined. There needs to be some expectations clearly outlined on this somewhere, and I'm not sure what they should be.
The text was updated successfully, but these errors were encountered: