How to make a named tuple from a dictionary?

Tada:

julia> (; Dict(:a => 5, :b => 6, :c => 7)...)
(a = 5, b = 6, c = 7)

(Edit: note, that this already worked in Julia 0.7 when NamedTuples first appeared. Sometimes it just takes a bit longer to find the best solution…)

41 Likes