-
-
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
allow passing multiple arguments to append! & prepend! #36227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the rational for the |
It might make sense if |
Alright I buy that, but @StefanKarpinski or @JeffBezanson want to give a quick second opinion? |
Agree with what @tkf said, including the rationale and the potential regret. |
47733ed
to
3d9da1f
Compare
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
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)
.