Passing keyword varargs into a function as an iterable input

I have a function that accepts varargs as keyword arguments. Namely:
function Foo(x; kw...) some calculations vs... end

When I pass on the keyword arguments explicitly I get the desired result.
That is if I explicitly write:
Foo(SomeInput, Argument1 = (SomeTupleElement, SomeTupleElement), Argument2 = (SomeTupleElement, SomeTupleElement)
I get the desired result.
Yet I want to put my keyword varargs into a collection (an array, a vector, a tuple, a named tuple, a pair, anything really) and pass that collection as argument to Foo.
That is I wish to be able to create some object MyKeywordVarargs and write Foo(SomeInput, MyKeywordVarargs) and still obtain the same results.

Like so:

julia> f(;kw...) = kw                                                                                                                                                   
f (generic function with 1 method)                                                                                                                                      

julia> f(;(a=1, b=2)...)                                                                                                                                                
pairs(::NamedTuple) with 2 entries:                                                                                                                                     
  :a => 1                                                                                                                                                               
  :b => 2                                                                                                                                                               
2 Likes

Thanks a lot for your help.

You’re welcome. You should be able to mark this question as solved (saves other people also looking at this).