From Named Tuple to Struct

Is this a sufficient hint?

julia> module Foo

       struct switch
           x::Int
       end

       get_struct(name) = getfield(Foo, name)
       end
Main.Foo

julia> Foo.get_struct(:switch)(1)
Main.Foo.switch(1)
1 Like