The these are not simple array construction so it’s less clear if this translation is always correct. (i.e. you can’t easily lower
f.([1; 2; 3]) to
typed_vcat(f, 1, 2, 3))
Finally, now that I’m more wake up… the argument doesn’t hold in general.
[f(a), f(b), f(c)] isn’t the correct thing to compare.
Examples of problematic cases includes
In general, I don’t really find using
getindex for typed array construction problematic. For syntax, it’s consistent with other array construction/concatenation related syntax. For the implementation, it’s generic (i.e. doesn’t have the issue of only have vectorized version for a subset of functions) and doesn’t conflict with anything else (especially after
Tuple type is not a
Tuple anymore) so I don’t see a need to change it.