Passing keyword arguments through a thin wrapper without explicitly writing them out

This is what I missed :sweat_smile:

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

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

julia> g(a = 1, b = 2, c = 3)
Dict{Symbol,Int64} with 3 entries:
  :a => 1
  :b => 2
  :c => 3

Thanks to @mkborregaard in How to collect keyword arguments in a Dict? - #5 by mkborregaard

2 Likes