StaticArrays.jl
StaticArrays.jl copied to clipboard
Define Base.show for SArray and MArray.
This allows SArray and MArray to be printed (show, repr, etc) and read back into an object of the same type.
Fixes #692.
I'm not sure that it's preferable to print the content as a tuple though; e.g.,
A = @SMatrix [1 2; 3 4]
would now repr as SMatrix{2,2,Int}(1, 2, 3, 4). That seems OK for repr maybe, but it's not great for printing vectors of A. E.g., the default showing of [A, A, A] now becomes:
julia> [A, A, A]
3-element Vector{SMatrix{2, 2, Int64, 4}}:
SMatrix{2,2,Int64}(1, 3, 2, 4)
SMatrix{2,2,Int64}(1, 3, 2, 4)
SMatrix{2,2,Int64}(1, 3, 2, 4)
How about instead printing this as SA{T}[...]?
Xref #906 which has some discussion of what to print.