Unpacking Python's asterisk operator in Julia

Hi everyone, I’ve been using Python recently, and I’ve discovered the asterisk operator, which expands the elements of an array where it’s used. For example, the two following usages of the variable a are equivalent, being func a function with two parameters:

a = [1, 2]
func(a[0], a[1]) # explicit passing of the positional arguments
func(*a) # automatic unpacking of the positional arguments

I found it so useful, so I’m wondering about it exists something similar in Julia

In Julia, this is called splatting, and is done by a ... following the variable, e.g.

a = [1,2]
func(a...)
1 Like

Thank you, it seems to be exactly the same