How to pass set of attributes to command

I think you did not understand lawless-m’s suggestion.

julia> attribute_set_A = (; color = :red)
(color = :red,)

julia> attribute_set_B = (; markersize = 2)
(markersize = 2,)

julia> f(; color = :black, markersize = 1) = @show color, markersize
f (generic function with 1 method)

julia> f(; attribute_set_A...)
(color, markersize) = (:red, 1)
(:red, 1)

julia> f(; attribute_set_B...)
(color, markersize) = (:black, 2)
(:black, 2)

julia> f(; merge(attribute_set_A, attribute_set_B)...)
(color, markersize) = (:red, 2)
(:red, 2)

If you have an array of NamedTuples you can either do merge(nm_array...)... or foldl(merge, nm_array)...

2 Likes