# Can't access setindex for tuple

**URL:** <https://discourse.julialang.org/t/cant-access-setindex-for-tuple/7883>\
**Category:** New to Julia\
**Created:** [December 20, 2017, 5:25pm UTC](https://discourse.julialang.org/t/cant-access-setindex-for-tuple/7883 "2017-12-20T17:25:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fratrik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fratrik/32/678_2.png) [@fratrik](https://discourse.julialang.org/u/fratrik)\
**Post date:** [December 20, 2017, 5:25pm UTC](https://discourse.julialang.org/t/cant-access-setindex-for-tuple/7883/1 "2017-12-20T17:25:14Z")

</div>

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](https://github.com/JuliaLang/julia/blob/v0.6.2/base/tuple.jl#L27)

However,

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

```

produces this error:  
UndefVarError: setindex not defined

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [December 20, 2017, 5:32pm UTC](https://discourse.julialang.org/t/cant-access-setindex-for-tuple/7883/2 "2017-12-20T17:32:51Z")

</div>

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

```julia
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.
