allow passing multiple arguments to append! & prepend!#36227
Merged
allow passing multiple arguments to append! & prepend!#36227
Conversation
Member
|
What's the rational for the |
Member
|
It might make sense if |
Member
|
Alright I buy that, but @StefanKarpinski or @JeffBezanson want to give a quick second opinion? |
Member
|
Agree with what @tkf said, including the rationale and the potential regret. |
47733ed to
3d9da1f
Compare
Member
Author
|
News just added. As I think it's an uncontroversial change, I will merge soon. |
E.g. append!([1], [2], [3]) == [1, 2, 3]. The equivalent operation for sets (`union!`) and dictionaries (`merge!`) already supports multiple arguments, as well as `push!`. For `prepend!`, order is maintained in the same way as in `pushfirst!`: `prepend!([3], [1], [2]) == [1, 2, 3] == pushfirst!([3], 1, 2)`.
3d9da1f to
66c3717
Compare
aviatesk
added a commit
that referenced
this pull request
Jun 7, 2024
KristofferC
pushed a commit
that referenced
this pull request
Jun 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
E.g.
append!([1], [2], [3]) == [1, 2, 3].The equivalent operations for sets (
union!) and dictionaries (merge!)already support multiple arguments, as well as
push!.For
prepend!, order is maintained in the same way as inpushfirst!:prepend!([3], [1], [2]) == [1, 2, 3] == pushfirst!([3], 1, 2).