Matrix padding

ok, I started opening things up to look at doing Pretty-printing small n-d arrays, but I came across a interesting choice which I wanted to make sure wasn’t a deliberate design decision. the left and right padding are completely independent, so arrays of type Any look like they have twice as many cols as they really do:

julia> [1039201 "string"; "tst" 8888; 10 'a'; "row4" 5]
2×2 Matrix{Any}:
 1039201            "string"
        "tst"   8888
      10            'a'
        "row4"     5

. is there any specific reason it shouldn’t be:

julia> [1039201 "string"; "tst" 8888; 10 'a'; "row4" 5]
2×2 Matrix{Any}:
 1039201  "string"
 "tst"        8888
      10  'a'
 "row4"          5

?

edit: ok, guess I figured out why it’s not like above:

julia> ["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 0, 0, 0]
4-element Vector{Any}:
  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
 0
 0
 0

, but couldn’t it still be something like:

julia> [1039201 "string"; "tst" 8888; 10 'a'; "row4" 5]
2×2 Matrix{Any}:
 1039201  "string"
 "tst"    8888
      10  'a'
 "row4"      5

?

I’m going to assume it’s fine to fix this, because there are other little annoyances I’ve found with padding too.

matrices don’t take string elision into account:

julia> ["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 0 0 0 0;0 0 0 0 0]
2×5 Matrix{Any}:
  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ⋯ 23 bytes ⋯ "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  0  0  0  0
 0                                                                                         0  0  0  0

and when it thinks it should be shortening the matrix because of this it doesn’t actually remove any columns of the matrix:

julia> ["xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 0 0;0 0 0]
2×3 Matrix{Any}:
  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ⋯ 33 bytes ⋯ "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"  …  0  0
 0                                                                                                      0  
0

edit:

I actually did find something that aligns both directions, complex numbers:

julia> [1039201 "string"; "test" 8888; 10 'a'; 1+im 1021-4im]
4×2 Matrix{Any}:
 1039201             "string"                                
        "test"   8888
      10             'a'
      1+1im     1021-4im                                     

I think I can still overlap the columns if I’m careful about it though