-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
keepat! and deleteat!: inconsistencies and possible bugs #42065
Comments
I think the behavior of using Seems like there are in general a bunch of specializations for
Since it seems they're supposed to be complementary, I think we should mimic the behavior of |
Yes, but I assume that users would expect
Yes, but apart from
Booleans are numbers EXCEPT for indexing:
and I assume that users would want In particular the invariant I imagine is that |
@ararslan - I think it would be good that issue gets considered by someone before 1.7 release as |
Doesn't #39528 solve this? |
Yes - if that PR is merged it should be resolved. Then there is the other issue of corrupting the vectors unsupported by |
The state of input arguments to mutating functions is kind of undefined if the function throws an exception. Just take something like:
Having to ensure that the original array can be returned feels like it would require a lot of prechecking / defensive copying. |
The problem is that the user needs to know that |
Sure, added to the 1.7 milestone. Even if someone sees that and removes the milestone, it means they'll have looked at this. 😄 |
Thank you! Given the discussion my feeling is that:
|
In general I agree with this, but since |
This was tested under 1.7.0-beta4.
I start with what worries me with
keepat!
.The first issue is:
while the same as allowed for
deleteat!
:The second issue is that
keepat!
will corrupt a non-Vector
orBitVector
vector:Maybe better define it only for
Vector
andBitVector
and assume that if some custom vector implementsdeleteat!
it must also implementkeepat!
?Now to
deleteat!
issues.The first is:
The second issue is:
I can implement the changes when there is a decision what behaviors in these four cases I have listed are expected. Thank you!
The text was updated successfully, but these errors were encountered: