# Splatting, tuples, vectors

**URL:** <https://discourse.julialang.org/t/splatting-tuples-vectors/111721>\
**Category:** General Usage\
**Tags:** question, splat\
**Created:** [March 17, 2024, 9:05am UTC](https://discourse.julialang.org/t/splatting-tuples-vectors/111721 "2024-03-17T09:05:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [March 17, 2024, 9:05am UTC](https://discourse.julialang.org/t/splatting-tuples-vectors/111721/1 "2024-03-17T09:05:31Z")

</div>

I have the following MWE:

```julia
struct PlotX
    X
    Y
end

function test(X, Y...)
    len=length(Y)
    println(len)
    println(typeof(Y))
    PlotX(X, Y)
end

T = 0:0.1:2pi
X = sin.(T)
Y = cos.(T)
p1 = test(T, X, Y);
p2 = test(p1.X, p1.Y);
nothing

```

Output:

```julia
2
Tuple{Vector{Float64}, Vector{Float64}}
1
Tuple{Tuple{Vector{Float64}, Vector{Float64}}}

```

What I want to achieve is to use the struct `p1` and call the function `test` such that the second call has the same result as the first call.

How can I avoid to get a `Tuple{Tuple{Vector{Float64}, Vector{Float64}}}` and get a `Tuple{Vector{Float64}, Vector{Float64}}` in the second call instead?

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [March 17, 2024, 9:11am UTC](https://discourse.julialang.org/t/splatting-tuples-vectors/111721/2 "2024-03-17T09:11:30Z")

</div>

> [@ufechner7](#):
>
> `p2 = test(p1.X, p1.Y);`

This line needs to be `test(p1.X, p1.Y...)`

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [March 17, 2024, 9:30am UTC](https://discourse.julialang.org/t/splatting-tuples-vectors/111721/3 "2024-03-17T09:30:08Z")

</div>

Do you mean “splatting”?
