Funny that SA
doesn’t work with comprehensions.
julia> SA[1, 2, 3]
3-element SVector{3, Int64} with indices SOneTo(3):
1
2
3
julia> SA[x for x=1:3]
ERROR: MethodError: Cannot `convert` an object of type
Int64 to an object of type
SA
So for comprehensions, you have to use the macro? Sidenote, the space between the macrocall and the brackets is optional:
julia> SArray[@SArray[1,2,3] for _=1:4]
4-element Vector{SArray}:
[1, 2, 3]
[1, 2, 3]
[1, 2, 3]
[1, 2, 3]
julia> @SArray[@SArray[1,2,3] for _=1:4]
4-element SVector{4, SVector{3, Int64}} with indices SOneTo(4):
[1, 2, 3]
[1, 2, 3]
[1, 2, 3]
[1, 2, 3]