Vectors vs. Tuples and multiple dispatch

And, if you do want to work with tuples, you can write things recursively instead of writing out cases. These should get unrolled by the compiler to pretty much what you had:

julia> g(xs::Tuple, a) = (g(Base.front(xs), a)..., F(sum(xs), a))
       g(::Tuple{}, a) = (1,);

julia> g((1.2, 3.4, 5.6), 0.78) == f((1.2, 3.4, 5.6), 0.78)
true

julia> @btime g($(Ref(Tuple(x)))[], 0.5)  # same as SVector
4 Likes