Skip to content

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

@ornamentist

Description

@ornamentist

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions