Can't access setindex for tuple

Hi,

I found this function which is exactly what I wanted to do with my simple Tuple: https://github.com/JuliaLang/julia/blob/v0.6.2/base/tuple.jl#L27

However,

a = (1, 2)
b = setindex(a, 3, 1)

produces this error:
UndefVarError: setindex not defined

The function is not exported, so you need to prefix it with Base.

julia> x = (1,2,3)
(1, 2, 3)

julia> Base.setindex(x, 4, 3)
(1, 2, 4)

My understanding is that the fact that it’s unexported means that it may be changed in future versions of Julia.

2 Likes