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
Surprising return from insert_at #24
Comments
Good point. Let's:
|
Treating -1 as wrapping makes things far more difficult, because people would then expect -2, -3... - |
Good point, let's do that for now then. |
The behaviour of this has now changed. There is a test case demonstrating that when the index is greater than the length of the list then the value is appended. The documentation examples still refer to the old behaviour and there is no test case for a negative index. |
Handled this in #224. It looks like the wrapping behaviour was supported in the rescript version, so I made native match it, and added tests. Happy to have done it the other way, this was just easier. |
This surprised me:
Looking at the code, this happens because
take
anddrop
return the empty list when given values that are out of bounds.However, I would expect the function to do one of these:
The text was updated successfully, but these errors were encountered: