Tangential, but because I’ve come across something similar recently: wouldn’t it be better to write
size(i::Int) = ...
function t3(input)
... append!(vect, size(i))
end
i.e. define size outside of t3? Otherwise the function would be re-defined every time t3 is called, although I’m not sure this makes a difference in practice?
(and for OP: this is a very convoluted way of writing t3(input) = [i == 0 ? 3 : 4i for i ∈ 1:input] - you are working on an Vector{Any} when initialising things with [] which is terrible for performance)