Function arguments variable

Is there a variable within a function that will return all function arguments as a named tuple (or something similar). Would be useful when calling a second function, that uses a similar set of arguments.

f2(; a,b,c ) = a+b+c


function f1(; a, b)
    c=a+b
    f2(; c,   AllArgs...  )
begin

You can use slurping (documented here):

function f(; vars...)
    println(vars)
end

yielding

julia> f(; a=1, b=2)
Base.Pairs(:a => 1, :b => 2)

EDIT: for example:

f2(; a, b, c) = a + b + c

function f0(; vars...)
    c = vars[:a] + vars[:b]
    f2(; vars..., c=c)
end
2 Likes