I am trying to write a function that calls several functions that accept named parameters. I'd like the A function to be able to named parameters splatted together in args and pass along the matching arguments to the functions it calls.
function A(x, y; args...)
B(x; args...)
C(y; args...)
end
function B(x; a=0)
println(x,a)
end
function C(y; a=0, b=0)
println(y,a,b)
end
funcA(1, 2) # Works
funcA(1, 2, a=1) # Works
funcA(1, 2, a=1, b=1) # Error: unrecognized keyword argument "b"
What is the preferred way of getting this to work? Adding "args..." into the argument list of B fixes the error, but I'm not sure if it's a good idea (e.g. is there any performance hit).