What is this for syntax called?

There are other distinctions between “list” and “array” that are probably more relevant: Julia array comprehensions can produce arrays of any dimensionality, and generally try to mimic the axes of the things you iterate over (e.g. offset axes, named axes, block arrays):

julia> using OffsetArrays

julia> X = -1:1;

julia> Y = OffsetArray(reshape(1:6,3,:), 2, -3);

julia> [(x,y) for x in X, y in Y]
3×3×2 OffsetArray(::Array{Tuple{Int64, Int64}, 3}, 1:3, 3:5, -2:-1) with eltype Tuple{Int64, Int64} with indices 1:3×3:5×-2:-1:
[:, :, -2] =
 (-1, 1)  (-1, 2)  (-1, 3)
 (0, 1)   (0, 2)   (0, 3)
 (1, 1)   (1, 2)   (1, 3)

[:, :, -1] =
 (-1, 4)  (-1, 5)  (-1, 6)
 (0, 4)   (0, 5)   (0, 6)
 (1, 4)   (1, 5)   (1, 6)
1 Like