Skip to content

Prepending/appending a list of ArrayPartition #288

@olivierverdier

Description

@olivierverdier

Wiht, say, floats, I can do

L = [1]
prepend!(L, 0) # now L == [0,1]

But if I do instead:

a = (rand(5), rand(5))
pA = ArrayPartition(a)
pB = ArrayPartition(a)
L = [pA]
prepend!(L, pB)

I get an error, namely Cannot `convert` an object of type Float64 to an object of type ArrayPartition{Float64, Tuple{Vector{Float64}, Vector{Float64}}}.

What is going on? Is it the expected behaviour, and if it is, how to properly use vectors of ArrayPartition without running into this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions