07-18-2023, 11:48 PM
What is this language construct called?
In Python I can say:
def a(b,c): return b+c
a(*[4,5])
and get 9. Likewise in Ruby:
def a(b,c) b+c end
a(*[4,5])
What is this called, when one passes a single array to a function which otherwise requires multiple arguments?
What is the name of the `*` operator?
What other languages support this cool feature?
In Python I can say:
def a(b,c): return b+c
a(*[4,5])
and get 9. Likewise in Ruby:
def a(b,c) b+c end
a(*[4,5])
What is this called, when one passes a single array to a function which otherwise requires multiple arguments?
What is the name of the `*` operator?
What other languages support this cool feature?