Possible bug in prepend!?

You are looking for pushfirst!. prepend!, like append!, expects multiple entries to iterate over and push into the collection.

Examples:

julia> A = Int[0]
1-element Vector{Int64}:
 0

julia> push!(A, 1)
2-element Vector{Int64}:
 0
 1

julia> pushfirst!(A, -1)
3-element Vector{Int64}:
 -1
  0
  1

julia> append!(A, [2, 3])
5-element Vector{Int64}:
 -1
  0
  1
  2
  3

julia> prepend!(A, [-3, -2])
7-element Vector{Int64}:
 -3
 -2
 -1
  0
  1
  2
  3
6 Likes