Add missing functions from Array to Dynarray#13296
Conversation
gasche
left a comment
There was a problem hiding this comment.
This looks fine, but I would propose to systematically (and consistently) call check_same_length outside the loop function:
let rec loop i = ...
in
let res = loop 0 in
check_same_length "..." a ~length;
res
|
Sure, that seems reasonable. I'll make that change. |
|
Could you call |
|
Sure. |
|
Hey @gasche; apologies for the bump. Is there anything else you'd like me to implement/change for this patch? |
There was a problem hiding this comment.
I believe that this is correct, and it seems sensible to complete the API with more Array functions.
Per the rules of stdlib maintenance, this needs an approval from another maintainer before we can consider merging this. (Hopefully one of them will receive this in their mailbox and decide to have a look.)
|
Looking at the |
|
Note that I think it is probably better to left the hypothetical addition of |
|
Sorry about that; must have edited the file after I ran the scripts. |
|
I believe that the new functions are missing |
|
... and a Changes entry in the "Standard library" section. |
|
Added. Apologies if the |
|
Merged, thanks! |
|
Thank you! (and thank you both for putting up with my learnings of the process 😅) |
Added:
All implementations are based off the implementation in Array. I have tried my best, based on the given comments, and other functions, to add all the correct checks; if I have missed any, please feel free to note or edit, and similar with the quality/number of tests - please inform me if these are not sufficient.
I also apologies; I could not quite figure out the format of the "Changes" file, so I haven't included that change here currently.
Background:
I was attempting to port some code from
ListtoDynarray; I promptly realized thatDynarraydid not havefind_optor similar, and decided that it would probably be easier to implement them myself than raise an issue and wait for someone else to do it.