Skip to content
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

Best way to insert multiple elements into a pvector? #290

Open
ornamentist opened this issue Jul 11, 2024 · 0 comments
Open

Best way to insert multiple elements into a pvector? #290

ornamentist opened this issue Jul 11, 2024 · 0 comments

Comments

@ornamentist
Copy link

Is there a recommended way to insert multiple elements at a position in a pvector? The equivalent of the following Python list code:

>>> xs = [1, 2, 6, 7]
>>> xs[2:2] = [3, 4, 5]
>>> xs
[1, 2, 3, 4, 5, 6, 7]

I can see I could join three pvectors if necessary: a prefix vector, the inserted elements and a suffix vector but I figure there's probably a better way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant