How to undef a vector element

There is an internal Base._unsetindex function for that:

julia> x = [1, 'b', "c"]; Base._unsetindex!(x, 2)
3-element Vector{Any}:
   1
 #undef
    "c"

It’s used for example to implement deleteat!.

2 Likes