About three dot in julia vector

I am a newer to julia, and cannot understand the use of three dot although have read some documents.
For example as follows: A is two elements vector of (x,y); B is six elements vector of (1,2,3,4,5,6); C is four elements vector of (1,2,3, y) and D is four elements vector of (x,4,5,6).
How do I understand ...here?
Thank you very much for your help.

x, y = [1,2,3], [4,5,6]
A = [x, y]
B = [x..., y...]
C = [x..., y]
D = [x, y...]

Could you explain what exactly you have trouble with? I’m assuming you have read

Frequently Asked Questions · The Julia Language…-operator-do?

which explains what splatting is, and it seems (at least to me!) that you’ve got a good set of examples already:

julia> A = [x, y]
2-element Vector{Vector{Int64}}:
 [1, 2, 3]
 [4, 5, 6]

julia> B = [x..., y...]
6-element Vector{Int64}:

when we splat an argument it should be read as if each element of the splatted collection is a separate function argument, i.e.:

julia> [x..., y...] == [x[1], x[2], x[3], y[1], y[2], y[3]]
1 Like

Thank you, nilshg, I have known the meaning of splatting, it treat each element in the vector as a new, separate element. I was very curious about this example just now, and I couldn’t understand the instructions in the manual.

Thank you very much for your immediately reply.

1 Like