julia> function Test(u,v,w)
x = sum(v)
y = prod(v)
z = u .+ v
return (x,y,z)
end
Test (generic function with 1 method)
julia> x = Test([1,2],[2,3],[3,4])[1]
5
julia> y = Test([1,2],[2,3],[3,4])[2]
6
julia> z = Test([1,2],[2,3],[3,4])[3]
2-element Array{Int64,1}:
3
5
I actually didn’t know you could destructure like that. I sat here searching for like 30 seconds trying to figure out what comma you were talking about before I spotted it. For what it’s worth, even knowing that such destructuring is possible I find x, _, _ = Test(...) far more readable.