-
-
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
Add append(_, _) and ++ #56943
base: master
Are you sure you want to change the base?
Add append(_, _) and ++ #56943
Conversation
Tagging triage to discuss a substantial new feature |
how does this differ from |
|
It would be nice indeed to have a function that just concatenates two collections! Such a simple building block was surprisingly missing from Julia afaik. |
well there are I am not sure that I am convinced there needs to exist a singular overarching stick-em-together function if the value-add is primarily "magic"ness vs using a more bespoke function for the object. and to that end I still don't really get what this would actually mean semantically. for example and similarly states
which I don't really get because I thought this was supposed to be like a type-stable anyway I do not actually feel too strongly about the addition of a function like this or not; I would just hope it's added because it's filling a real need rather than just tweaking some of the conventions chosen for the existing functions (e.g. the concern about I would definitely definitely say that |
Neither of them does "concatenate two collections" I think. Even when we limit ourselves to just two common Base types, tuples and vectors. |
tuples and vectors (any 1d array type, wouldn't have to be necessarily the PR as written seems to be saying |
The big question seems to be: In what context would you have code which wants to be generic over things this function accepts, rather than just the things accepted by There is some code generic over What's downstream of this has to do something beyond iterating, else Then are lots of detail questions, like is |
:d | ||
``` | ||
""" | ||
(append(x::T, y::T) where T<: AbstractVector) = append!(copy(x), y) |
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.
Should probably be copymutable
?
Draft for #53040
Adds
append(_, _)
and++
to concatenate two sequences.